Skip to content

Commit 12abb60

Browse files
committed
[usage] Add warning alert when usage reconciliation has not been succesfull for more than an hour
1 parent 041ee76 commit 12abb60

File tree

1 file changed

+10
-10
lines changed
  • operations/observability/mixins/meta/rules

1 file changed

+10
-10
lines changed

operations/observability/mixins/meta/rules/usage.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ spec:
1414
groups:
1515
- name: usage
1616
rules:
17-
- alert: GitpodUsageReconcileUsageFailures'
18-
expr: sum(increase(grpc_server_handled_total{grpc_service="usage.v1.UsageService", grpc_method="ReconcileUsage", grpc_code!="OK"})) > 1
17+
- alert: GitpodUsageReconcileInvoicesFailures'
18+
expr: sum(increase(grpc_server_handled_total{grpc_service="usage.v1.BillingService", grpc_method="ReconcileInvoices", grpc_code!="OK"})) > 1
1919
for: 30m
2020
labels:
2121
severity: warning
2222
team: webapp
2323
annotations:
24-
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodUsageReconcileUsageFailures.md
25-
summary: There are failed usage reconciliations.
26-
description: We have accumulated {{ printf "%.2f" $value }} failures. This affects how up-to-date usage data is.
24+
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodUsageReconcileInvoicesFailures.md
25+
summary: There are failed Stripe invoice reconciliations.
26+
description: We have accumulated {{ printf "%.2f" $value }} failures. This affects how much customers will be billed.
2727

28-
- alert: GitpodUsageReconcileInvoicesFailures'
29-
expr: sum(increase(grpc_server_handled_total{grpc_service="usage.v1.BillingService", grpc_method="ReconcileInvoices", grpc_code!="OK"})) > 1
28+
- alert: GitpodUsageTooLongSinceLastSuccessfulLedgerReconciliation
29+
expr: (time() - gitpod_usage_ledger_last_completed_time{outcome!="success"}) > 60 * 60
3030
for: 30m
3131
labels:
3232
severity: warning
3333
team: webapp
3434
annotations:
35-
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodUsageReconcileInvoicesFailures.md
36-
summary: There are failed Stripe invoice reconciliations.
37-
description: We have accumulated {{ printf "%.2f" $value }} failures. This affects how much customers will be billed.
35+
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodUsageTooLongSinceLastSuccessfulLedgerReconciliation.md
36+
summary: Usage reconciliation has not run successfully for {{ printf "%.2f" $value }} seconds. Usage data is stale.
37+
description: We have not executed scheduled usage reconciliation for {{ printf "%.2f" $value }} seconds. We expect the data to update every 15 minutes to avoid stale usage records and stale invoices.

0 commit comments

Comments
 (0)