apiVersion: rules.alerting.grafana.app/v0alpha1 kind: AlertRule metadata: annotations: grafana.app/folder: anthropic grafana.com/provenance: '' grafana.com/updateTimestamp: '2026-03-20T11:22:55Z' grafana.com/updatedBy: bf1wptf89bpq8d labels: grafana.app/folder: anthropic grafana.com/group: anthropic grafana.com/group-index: '2' name: eec2ad9e-30b9-5c8f-802f-53e26ab8fdc9 namespace: stacks-890472 spec: annotations: description: 'The last completed day cost ${{ $value | humanize }}, above the $1000 threshold. The cost metric updates once a day at about 03:00 UTC, so this describes yesterday.' summary: Anthropic API cost threshold exceeded. execErrState: Ok expressions: prometheus_math: model: datasource: IsPrunable: false access: '' apiVersion: '' basicAuth: false basicAuthUser: '' created: '0001-01-01T00:00:00Z' database: '' id: -100 isDefault: false jsonData: {} name: __expr__ readOnly: false secureJsonData: {} type: __expr__ uid: __expr__ updated: '0001-01-01T00:00:00Z' url: '' user: '' withCredentials: false expression: is_number($query) || is_nan($query) || is_inf($query) intervalMs: 1000 maxDataPoints: 43200 refId: prometheus_math type: math queryType: math query: datasourceUID: grafanacloud-prom model: datasource: type: prometheus uid: grafanacloud-prom expr: | sum(increase(gen_ai_cost{job=~"integrations/anthropic/.*"}[1d])) / 100 > 1000 instant: true intervalMs: 1000 maxDataPoints: 43200 range: false refId: query queryType: prometheus relativeTimeRange: from: 11m0s to: 1m0s threshold: model: conditions: - evaluator: params: - 0 type: gt datasource: IsPrunable: false access: '' apiVersion: '' basicAuth: false basicAuthUser: '' created: '0001-01-01T00:00:00Z' database: '' id: -100 isDefault: false jsonData: {} name: __expr__ readOnly: false secureJsonData: {} type: __expr__ uid: __expr__ updated: '0001-01-01T00:00:00Z' url: '' user: '' withCredentials: false expression: prometheus_math intervalMs: 1000 maxDataPoints: 43200 refId: threshold type: threshold queryType: threshold source: true for: 15m0s labels: __converted_prometheus_rule__: 'true' severity: critical missingSeriesEvalsToResolve: 10 noDataState: Ok title: AnthropicHighCostThreshold trigger: interval: 1m