forked from mtusi2026/mtusi2026lab6
Implement lab6 observability with OpenTelemetry and Grafana
This commit is contained in:
@@ -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
|
||||
@@ -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']
|
||||
Reference in New Issue
Block a user