Files
mtusi2026lab6/infra/prometheus/tests/messenger.test.yml
T

56 lines
2.3 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.
rule_files:
- ../rules/messenger.yml
evaluation_interval: 15s
tests:
- name: "Рост ошибок API и восстановление"
interval: 15s
input_series:
- series: 'http_requests_total{service_name="messenger-api",http_route="/api/v1/users/me",http_response_status_class="2xx"}'
values: '0+27x48'
- series: 'http_requests_total{service_name="messenger-api",http_route="/api/v1/users/me",http_response_status_class="5xx"}'
values: '0+3x16 48+0x32'
alert_rule_test:
- eval_time: 1m
alertname: MessengerHighAPIErrorRate
exp_alerts: []
- eval_time: 3m
alertname: MessengerHighAPIErrorRate
exp_alerts:
- exp_labels:
severity: warning
exp_annotations:
summary: "Повышенная доля ответов 5xx API"
description: "Доля 5xx выше 5% при нагрузке от 0,2 запроса/с за последние 5 минут."
runbook: "REPORT.md#высокая-доля-ошибок-api"
- eval_time: 11m
alertname: MessengerHighAPIErrorRate
exp_alerts: []
- name: "Рост очереди и её последующее опустошение"
interval: 15s
input_series:
- series: 'rabbitmq_detailed_queue_messages_ready{job="rabbitmq",vhost="/",queue="attachments.process",instance="rabbitmq:15692"}'
values: '0+1x16 16-1x16 0+0x12'
alert_rule_test:
- eval_time: 2m
alertname: MessengerGrowingAttachmentQueue
exp_alerts: []
- eval_time: 4m
alertname: MessengerGrowingAttachmentQueue
exp_alerts:
- exp_labels:
severity: warning
job: rabbitmq
vhost: /
queue: attachments.process
instance: rabbitmq:15692
exp_annotations:
summary: "Растёт очередь обработки вложений"
description: "В attachments.process ожидают как минимум 5 заданий и глубина очереди растёт в пятиминутном окне."
runbook: "REPORT.md#растущая-очередь-вложений"
- eval_time: 9m
alertname: MessengerGrowingAttachmentQueue
exp_alerts: []