Лабораторная 6: наблюдаемость мессенджера

This commit is contained in:
2026-11-21 11:32:12 +03:00
parent 470d9d6f1e
commit 59a3f96a82
94 changed files with 6746 additions and 35 deletions
+28
View File
@@ -0,0 +1,28 @@
groups:
- name: messenger
rules:
- alert: HighApiErrorRate
expr: sum(rate(messenger_http_requests_total{status_class="5xx"}[1m])) / clamp_min(sum(rate(messenger_http_requests_total[1m])), 0.001) > 0.01
for: 6s
labels:
severity: warning
annotations:
summary: API 5xx exceeds 1% over 1 minute
description: SLO is 99% non-5xx business requests over 5 minutes. Inspect PostgreSQL client spans and pool metrics.
runbook_url: http://localhost:13000/d/messenger/messenger?viewPanel=5
- alert: QueueLagGrowing
expr: messenger_queue_oldest_age_seconds > 15 and messenger_queue_depth > 0 and on(service_instance_id) (time() - messenger_queue_observed_at_seconds < 10)
for: 6s
labels:
severity: warning
annotations:
summary: Oldest unfinished job exceeds 15 seconds
description: Inspect worker capacity, busy gauge and consumer traces. Restore worker and verify backlog drains. See infra/runbook.md.
- alert: QueueObservationStale
expr: time() - max(messenger_queue_observed_at_seconds) > 15
for: 6s
labels:
severity: warning
annotations:
summary: Publisher backlog observations are stale
description: Check publisher and PostgreSQL availability before trusting queue gauges.
+11
View File
@@ -0,0 +1,11 @@
global:
scrape_interval: 3s
evaluation_interval: 3s
rule_files: [/etc/prometheus/alerts.yaml]
scrape_configs:
- job_name: application
static_configs:
- targets: [otel-collector:8889]
- job_name: collector
static_configs:
- targets: [otel-collector:8888]