Lab 7
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-27 20:47:58 +03:00
parent 20afc2c790
commit d995f98446
97 changed files with 8638 additions and 56 deletions
+46
View File
@@ -0,0 +1,46 @@
# Alert rules (grade 4). Local firing/resolved state only; no external delivery.
# Error ratio excludes health endpoints and 4xx (client mistakes), so a wrong
# password is not confused with a real server failure.
groups:
- name: messenger-sli
rules:
- alert: HighErrorRate
expr: |
(
sum(rate(http_server_requests_total{status_class="5xx",route!~".*health.*"}[5m]))
/
clamp_min(sum(rate(http_server_requests_total{route!~".*health.*"}[5m])), 1)
) > 0.05
for: 2m
labels:
severity: warning
annotations:
summary: "API 5xx ratio above 5% of business requests"
description: "5xx / business requests > 5% for 2 minutes. Runbook: docs in REPORT.md (incident 2)."
- alert: QueueLagGrowing
expr: messenger_queue_oldest_job_age_seconds > 30
for: 2m
labels:
severity: warning
annotations:
summary: "Oldest queued attachment job is older than 30s"
description: "Backlog is not draining (worker down or overloaded). Runbook: REPORT.md incident 1."
- alert: QueueDepthHigh
expr: messenger_queue_depth > 20
for: 2m
labels:
severity: info
annotations:
summary: "Attachment queue depth above 20"
description: "Sustained backlog; check worker capacity and processing time."
- alert: WorkerInactive
expr: max(messenger_worker_capacity) == 0
for: 1m
labels:
severity: warning
annotations:
summary: "No worker reporting capacity"
description: "The worker is not exporting metrics (stopped or telemetry broken)."