Лаб6 - оценка 4
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
global:
|
||||
scrape_interval: 10s
|
||||
evaluation_interval: 10s
|
||||
|
||||
rule_files:
|
||||
- /etc/prometheus/rules.yml
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'otel-collector'
|
||||
static_configs:
|
||||
- targets: ['otelcol:8889']
|
||||
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
@@ -0,0 +1,45 @@
|
||||
groups:
|
||||
- name: messenger-slo
|
||||
rules:
|
||||
- alert: ApiHighErrorRate
|
||||
expr: sum(http_server_request_duration_seconds_count{service_name="messenger-api",http_response_status_code=~"5.."}) > 10
|
||||
for: 30s
|
||||
labels:
|
||||
severity: critical
|
||||
slo: availability
|
||||
annotations:
|
||||
summary: "More than 10 total 5xx responses"
|
||||
description: "Total 5xx count: {{ $value }}"
|
||||
|
||||
- alert: AttachmentQueueLagHigh
|
||||
expr: attachment_jobs_oldest_age_seconds > 60
|
||||
for: 1m
|
||||
labels:
|
||||
severity: warning
|
||||
slo: freshness
|
||||
annotations:
|
||||
summary: "Oldest unfinished attachment job > 60s"
|
||||
|
||||
- alert: WorkerStalled
|
||||
expr: |
|
||||
attachment_jobs_queue_depth > 0
|
||||
and
|
||||
increase(worker_jobs_processed_total{status="done"}[10m]) == 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: critical
|
||||
slo: freshness
|
||||
annotations:
|
||||
summary: "Queue non-empty but no jobs completed in 10m"
|
||||
|
||||
- alert: ApiLatencyP95High
|
||||
expr: |
|
||||
histogram_quantile(0.95,
|
||||
sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name="messenger-api"}[5m]))
|
||||
) > 0.5
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
slo: latency
|
||||
annotations:
|
||||
summary: "API p95 latency > 500ms"
|
||||
Reference in New Issue
Block a user