forked from mtusi2026/mtusi2026lab6
Lab 6: track - 1
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
groups:
|
||||
- name: messenger-slo-alerts
|
||||
rules:
|
||||
- alert: HighApiErrorRatio
|
||||
expr: >
|
||||
sum(rate(http_server_requests_total{service_name="messenger-api",http_route!~"/health/.*",http_response_status_class="5xx"}[1m]))
|
||||
/ clamp_min(sum(rate(http_server_requests_total{service_name="messenger-api",http_route!~"/health/.*"}[1m])), 0.001) > 0.05
|
||||
for: 15s
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "High API 5xx error ratio (> 5%)"
|
||||
runbook: "infra/otel/RUNBOOKS.md#1-high-api-5xx-error-ratio-messenger-high-5xx"
|
||||
- alert: GrowingQueueLag
|
||||
expr: max(worker_oldest_job_age_seconds{queue_name="attachment-jobs"}) > 15
|
||||
for: 15s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Oldest attachment job age exceeds 15s"
|
||||
runbook: "infra/otel/RUNBOOKS.md#2-growing-queue-lag-messenger-queue-lag"
|
||||
- alert: ApiLatencySloBreach
|
||||
expr: histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name="messenger-api",http_route!~"/health/.*"}[1m]))) > 0.5
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "API p95 latency exceeds 500ms SLO"
|
||||
runbook: "infra/otel/RUNBOOKS.md#3-api-p95-latency-slo-breach-messenger-latency-slo"
|
||||
@@ -0,0 +1,14 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
evaluation_interval: 5s
|
||||
|
||||
rule_files:
|
||||
- /etc/prometheus/alerts.yml
|
||||
|
||||
scrape_configs:
|
||||
- job_name: otel-pipeline
|
||||
static_configs:
|
||||
- targets: ['otel-collector:8889']
|
||||
- job_name: otel-collector-internal
|
||||
static_configs:
|
||||
- targets: ['otel-collector:8888']
|
||||
Reference in New Issue
Block a user