Реализовать уровень 4: сквозные трассы, SLO, отказы и отчёт
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
groups:
|
||||
- name: messenger-lab6
|
||||
interval: 5s
|
||||
rules:
|
||||
- alert: MessengerHighErrorRate
|
||||
expr: |
|
||||
(
|
||||
sum(rate(messenger_http_requests_total{service_name="messenger-api",route!~"/health/.*",status_class="5xx"}[1m]))
|
||||
/
|
||||
clamp_min(sum(rate(messenger_http_requests_total{service_name="messenger-api",route!~"/health/.*"}[1m])), 1e-9)
|
||||
) > 0.05
|
||||
for: 10s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Business API 5xx ratio exceeds 5%"
|
||||
description: "5xx / all business HTTP responses over 1 minute, continuously above 5% for 10 seconds. Health and client 4xx are not failures in this SLI."
|
||||
runbook: "infra/otel/RUNBOOK.md#api-errors"
|
||||
- alert: MessengerQueueLag
|
||||
expr: |
|
||||
max(messenger_queue_oldest_age_seconds{service_name="messenger-publisher"}) > 15
|
||||
and
|
||||
max(messenger_queue_depth{service_name="messenger-publisher"}) > 0
|
||||
and
|
||||
max(messenger_queue_sample_age_seconds{service_name="messenger-publisher"}) < 10
|
||||
for: 10s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Oldest unfinished attachment job exceeds 15 seconds"
|
||||
description: "Durable PostgreSQL backlog is nonempty and oldest job age is above 15 seconds for 10 seconds; the observer sample is less than 10 seconds old. This is queue age, not worker processing duration."
|
||||
runbook: "infra/otel/RUNBOOK.md#queue-lag"
|
||||
@@ -2,6 +2,9 @@ global:
|
||||
scrape_interval: 5s
|
||||
evaluation_interval: 5s
|
||||
|
||||
rule_files:
|
||||
- /etc/prometheus/alerts.yaml
|
||||
|
||||
scrape_configs:
|
||||
- job_name: messenger
|
||||
static_configs:
|
||||
|
||||
Reference in New Issue
Block a user