Skip to content

[alerts] Reduce trigger duration for Stripe Webhook Failure alert #15953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions operations/observability/mixins/meta/rules/public-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ spec:
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/PublicAPI_ServiceReturningServerErrors.md
summary: PublicAPI serves multiple different Services and RPC. There have been failing requests due to server errors. Investigation required.
description: Service {{ $labels.package }}.{{ $labels.call }} has returned {{ printf "%.2f" $value }} server errors in the last 10 minutes.

- alert: GitpodStripeWebhookFailures
expr: sum(increase(gitpod_http_request_duration_seconds_count{handler="/stripe/invoices/webhook", code=~"5.*"}[30m])) > 0
for: 10m
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces the trigger period to 10m

labels:
severity: warning
team: webapp
annotations:
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodUsageStripeWebhookFailures.md
summary: Detected {{ printf "%.2f" $value }} errors handling Stripe webhook.
description: Stripe is sending us webhooks but we are failing to handle them. Inconsistent usage data very likely.
11 changes: 0 additions & 11 deletions operations/observability/mixins/meta/rules/usage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ spec:
summary: Usage reconciliation has not run successfully for {{ printf "%.2f" $value }} seconds. Usage data is stale.
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.

- alert: GitpodUsageStripeWebhookFailures
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moves this alert to the public-api file, as it's more appropriate given that's the receiver of the webhook

expr: sum(increase(gitpod_http_request_duration_seconds_count{handler="/stripe/invoices/webhook", code=~"5.*"}[30m])) > 0
for: 30m
labels:
severity: warning
team: webapp
annotations:
runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodUsageStripeWebhookFailures.md
summary: Detected {{ printf "%.2f" $value }} errors handling Stripe webhook.
description: Stripe is sending us webhooks but we are failing to handle them. Inconsistent usage data very likely.

- alert: UsageHighCPUUsage
# Reasoning: high rates of CPU consumption should only be temporary.
expr: avg(rate(container_cpu_usage_seconds_total{container!="POD", pod=~"usage-.*"}[5m])) by (cluster) > 0.2
Expand Down