Files
mtusi2026lab6/infra/prometheus/rules/messenger.yml
T

34 lines
1.6 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
interval: 15s
rules:
- alert: MessengerHighAPIErrorRate
expr: |
(
sum(rate(http_requests_total{service_name="messenger-api",http_route=~"/api/.*",http_response_status_class="5xx"}[5m]))
/
sum(rate(http_requests_total{service_name="messenger-api",http_route=~"/api/.*"}[5m]))
) > 0.05
and
sum(rate(http_requests_total{service_name="messenger-api",http_route=~"/api/.*"}[5m])) >= 0.2
for: 2m
labels:
severity: warning
annotations:
summary: "Повышенная доля ответов 5xx API"
description: "Доля 5xx выше 5% при нагрузке от 0,2 запроса/с за последние 5 минут."
runbook: "REPORT.md#высокая-доля-ошибок-api"
- alert: MessengerGrowingAttachmentQueue
expr: |
rabbitmq_detailed_queue_messages_ready{job="rabbitmq",vhost="/",queue="attachments.process"} >= 5
and
deriv(rabbitmq_detailed_queue_messages_ready{job="rabbitmq",vhost="/",queue="attachments.process"}[5m]) > 0
for: 2m
labels:
severity: warning
annotations:
summary: "Растёт очередь обработки вложений"
description: "В attachments.process ожидают как минимум 5 заданий и глубина очереди растёт в пятиминутном окне."
runbook: "REPORT.md#растущая-очередь-вложений"