forked from mtusi2026/mtusi2026lab6
Добавил наблюдаемость: OpenTelemetry, Prometheus, Loki, Tempo, Grafana
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
global:
|
||||
scrape_interval: 10s
|
||||
evaluation_interval: 10s
|
||||
|
||||
rule_files:
|
||||
- /etc/prometheus/rules/*.yml
|
||||
|
||||
scrape_configs:
|
||||
- job_name: otel-collector
|
||||
static_configs:
|
||||
- targets: ["otel-collector:8888"]
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
|
||||
otlp:
|
||||
promote_resource_attributes:
|
||||
- service.version
|
||||
- deployment.environment.name
|
||||
@@ -0,0 +1,23 @@
|
||||
groups:
|
||||
- name: messenger-slo
|
||||
rules:
|
||||
- alert: ApiHighErrorRate
|
||||
expr: |
|
||||
sum(rate(http_server_requests_total{http_response_status_class="5xx"}[1m]))
|
||||
/ sum(rate(http_server_requests_total[1m])) > 0.05
|
||||
for: 20s
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: "API 5xx ratio above 5% over 1m"
|
||||
description: "SLI: share of non-5xx business requests; SLO 99% over 30d. Fast-burn check on a 1m window."
|
||||
runbook: "infra/runbook.md#apihigherrorrate"
|
||||
- alert: QueueLagGrowing
|
||||
expr: max(queue_oldest_job_age_seconds{queue="attachments.jobs"}) > 20
|
||||
for: 20s
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: "Oldest queued job older than 20s"
|
||||
description: "SLO: 95% of attachments reach ready within 10s over 30d. A job waiting more than 20s means the worker does not keep up."
|
||||
runbook: "infra/runbook.md#queuelaggrowing"
|
||||
Reference in New Issue
Block a user