Instrument durable messenger with OTel, provision Grafana and prove SLO incident detection

This commit is contained in:
2026-11-21 00:58:18 +03:00
parent 470d9d6f1e
commit bd2c7f7b37
89 changed files with 15839 additions and 25 deletions
+29
View File
@@ -0,0 +1,29 @@
groups:
- name: messenger
interval: 2s
rules:
- alert: APIHighErrorRate
expr: (sum(rate(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"}[30s])) or vector(0)) / clamp_min(sum(rate(haproxy_backend_http_responses_total{proxy="replicas"}[30s])), 0.001) > 0.1
for: 6s
labels: {severity: warning}
annotations: {summary: 'API 5xx above 10% for 30s window', runbook: 'RUNBOOK.md#db'}
- alert: QueueLag
expr: max(messenger_queue_oldest_age_seconds) > 5 and max(messenger_queue_depth) > 0
for: 6s
labels: {severity: warning}
annotations: {summary: 'Oldest unfinished job exceeds 5s', runbook: 'RUNBOOK.md#worker'}
- alert: APIBudgetFastBurn
expr: ((sum(rate(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"}[10s])) or vector(0)) / clamp_min(sum(rate(haproxy_backend_http_responses_total{proxy="replicas"}[10s])),0.001) > 6 * 0.01) and ((sum(rate(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"}[60s])) or vector(0)) / clamp_min(sum(rate(haproxy_backend_http_responses_total{proxy="replicas"}[60s])),0.001) > 6 * 0.01)
for: 10s
labels: {severity: critical, slo: api_99}
annotations: {summary: 'API budget burn >6x in 10s and 60s', runbook: 'RUNBOOK.md#db'}
- alert: APIBudgetSlowBurn
expr: ((sum(rate(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"}[30s])) or vector(0)) / clamp_min(sum(rate(haproxy_backend_http_responses_total{proxy="replicas"}[30s])),0.001) > 2 * 0.01) and ((sum(rate(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"}[120s])) or vector(0)) / clamp_min(sum(rate(haproxy_backend_http_responses_total{proxy="replicas"}[120s])),0.001) > 2 * 0.01)
for: 20s
labels: {severity: warning, slo: api_99}
annotations: {summary: 'API budget burn >2x in 30s and 120s', runbook: 'RUNBOOK.md#db'}
- alert: ReadyBudgetFastBurn
expr: (sum(rate(messenger_attachment_sli_bad_total[10s])) / clamp_min(sum(rate(messenger_attachment_sli_total[10s])),0.001) > 6 * 0.05) and (sum(rate(messenger_attachment_sli_bad_total[60s])) / clamp_min(sum(rate(messenger_attachment_sli_total[60s])),0.001) > 6 * 0.05)
for: 10s
labels: {severity: critical, slo: ready_95}
annotations: {summary: 'Ready deadline budget burn >6x in 10s and 60s', runbook: 'RUNBOOK.md#worker'}
+12
View File
@@ -0,0 +1,12 @@
global:
scrape_interval: 2s
evaluation_interval: 2s
rule_files: [/etc/prometheus/alerts.yaml]
scrape_configs:
- job_name: messenger
static_configs: [{targets: ['collector:8889']}]
- job_name: collector
static_configs: [{targets: ['collector:8888']}]
- job_name: ingress
static_configs: [{targets: ['lb:8404']}]