Files
mtusi2026lab7/infra/prometheus/alerts.yml
T
2026-12-03 19:25:38 +03:00

32 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
groups:
- name: messenger-observability
rules:
- alert: ApiHigh5xxRatio
expr: sum(rate(otel_messenger_http_requests_total{http_status_class="5xx"}[5m])) / clamp_min(sum(rate(otel_messenger_http_requests_total[5m])), 0.001) > 0.05
for: 2m
labels: {severity: warning}
annotations:
summary: "Доля HTTP 5xx выше 5%"
description: "Проверьте API traces и логи по route/request_id. Runbook: REPORT.md#инциденты."
- alert: ApiHighP95Latency
expr: histogram_quantile(0.95, sum by (le) (rate(otel_messenger_http_request_duration_seconds_bucket[5m]))) > 1
for: 3m
labels: {severity: warning}
annotations:
summary: "p95 API выше 1 секунды"
description: "Сравните server span с DB/S3 spans и проверьте saturation. Runbook: REPORT.md#инциденты."
- alert: WorkerJobFailures
expr: sum(rate(otel_messenger_jobs_processed_total{outcome="error"}[5m])) > 0
for: 1m
labels: {severity: warning}
annotations:
summary: "Worker фиксирует ошибки обработки"
description: "Откройте job.process trace и структурный лог job.failed. Runbook: REPORT.md#инциденты."
- alert: TelemetryCollectorUnavailable
expr: up{job="otel-collector"} == 0
for: 1m
labels: {severity: critical}
annotations:
summary: "Prometheus не видит OTel Collector"
description: "Проверьте контейнер Collector и OTLP pipeline. Runbook: REPORT.md#инциденты."