Implement lab6 observability with OpenTelemetry and Grafana

This commit is contained in:
ferraronp
2026-11-17 19:14:43 +03:00
parent 470d9d6f1e
commit e636d4cc76
68 changed files with 5863 additions and 47 deletions
+19
View File
@@ -0,0 +1,19 @@
groups:
- name: messenger-lab
rules:
- alert: LabAPIHighErrorRate
expr: (sum(rate(lab_http_requests_total{route=~"/api/.*",status_class="5xx"}[30s])) or vector(0)) / clamp_min(sum(rate(lab_http_requests_total{route=~"/api/.*"}[30s])), 0.001) > 0.05
for: 9s
labels:
severity: warning
annotations:
summary: Business HTTP 5xx rate exceeds 5% over 30 seconds
runbook: REPORT.md#инциденты-и-runbook
- alert: LabQueueLag
expr: max(lab_queue_oldest_age_seconds) > 15 and max(lab_queue_depth) > 0
for: 12s
labels:
severity: warning
annotations:
summary: Oldest queued job exceeds 15 seconds (sustained 12 seconds)
runbook: REPORT.md#инциденты-и-runbook
+12
View File
@@ -0,0 +1,12 @@
global:
scrape_interval: 3s
evaluation_interval: 3s
rule_files:
- /etc/prometheus/alerts.yml
scrape_configs:
- job_name: lab-otlp
static_configs:
- targets: ['otel-collector:8889']
- job_name: collector-self
static_configs:
- targets: ['otel-collector:8888']