feat(monitoring): alert on billing processing failures #696

Sammanfogat
supernaut sammanfogade 2 incheckningar från feat/billing-failure-alerts in i main 2026-10-12 18:44:22 +00:00
Ägare

What

Adds the BillingPaymentProcessingFailing Loki alert (warning). It fires on one of these bitborg-billing lines in the last hour:

  • [webhook] failed
  • [webhook] ... has an open chargeback; left unprocessed
  • [refund] ... not issued
  • [sweep] ...
  • [reconcile] chargebacks not listed
  • [reconcile] chargebacks of ... not applied

The rule renders only when billing_enabled is true. Prod has payments off, but the complimentary sweep still runs and logs [sweep] errors. Adds a runbook section and a log-line test case.

Why

A revoked Mollie key leaves the container healthy and every webhook returns 500. Nothing alerted, and Mollie stops retrying after about 26 hours.

The webhook line is fixed text since bitborg-payment#139, so outside input cannot forge it.

Verified

  • scripts/test-alert-rules.py: new case matches every line shape above, including [sweep] complimentary and rejects was refunded or charged back ... left unprocessed, [reconcile] failed: and the startup line.
  • scripts/check-alert-rules.py: passes.
  • Loki rendered with the flag off and on: the rule is absent, then present.
  • Live Loki: container="bitborg-billing" has streams, same selector as BillingReconcileManualReview.
  • Not verified: a live match. Prod has payments disabled, so no such line exists.

Apply: --tags monitoring.

Closes #692

## What Adds the `BillingPaymentProcessingFailing` Loki alert (warning). It fires on one of these `bitborg-billing` lines in the last hour: - `[webhook] failed` - `[webhook] ... has an open chargeback; left unprocessed` - `[refund] ... not issued` - `[sweep] ...` - `[reconcile] chargebacks not listed` - `[reconcile] chargebacks of ... not applied` The rule renders only when `billing_enabled` is true. Prod has payments off, but the complimentary sweep still runs and logs `[sweep]` errors. Adds a runbook section and a log-line test case. ## Why A revoked Mollie key leaves the container healthy and every webhook returns 500. Nothing alerted, and Mollie stops retrying after about 26 hours. The webhook line is fixed text since bitborg-payment#139, so outside input cannot forge it. ## Verified - `scripts/test-alert-rules.py`: new case matches every line shape above, including `[sweep] complimentary` and rejects `was refunded or charged back ... left unprocessed`, `[reconcile] failed:` and the startup line. - `scripts/check-alert-rules.py`: passes. - Loki rendered with the flag off and on: the rule is absent, then present. - Live Loki: `container="bitborg-billing"` has streams, same selector as `BillingReconcileManualReview`. - Not verified: a live match. Prod has payments disabled, so no such line exists. Apply: `--tags monitoring`. Closes #692
supernaut lade till 2 incheckningar 2026-10-12 18:30:37 +00:00
supernaut sammanfogade incheckning a7b51214a2 till main 2026-10-12 18:44:22 +00:00
supernaut tog bort grenen feat/billing-failure-alerts 2026-10-12 18:44:22 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra!696
Ingen beskrivning angiven.