forked from mtusi2026/mtusi2026lab6
4 grade_and_report
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
groups:
|
||||
- name: lab6_alerts
|
||||
rules:
|
||||
# Правило 1: Высокий процент ошибок 5xx на API
|
||||
- alert: HighErrorRate
|
||||
expr: sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) > 0.05
|
||||
for: 2m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "High 5xx error rate detected"
|
||||
|
||||
# Правило 2: Ошибки в воркере
|
||||
- alert: WorkerErrors
|
||||
expr: worker_processed_total{result="error"} > 0
|
||||
for: 0m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Worker errors detected"
|
||||
@@ -2,16 +2,23 @@ global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
|
||||
rule_files:
|
||||
- "alerts.yml"
|
||||
|
||||
scrape_configs:
|
||||
|
||||
- job_name: "prometheus"
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
|
||||
|
||||
- job_name: "otel-collector"
|
||||
static_configs:
|
||||
- targets: ["otel-collector:8889"]
|
||||
|
||||
|
||||
- job_name: "api"
|
||||
metrics_path: /metrics
|
||||
static_configs:
|
||||
- targets: ["api1:8080", "api2:8080"]
|
||||
|
||||
- job_name: "prometheus"
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
- targets: ["api1:8080", "api2:8080"]
|
||||
Reference in New Issue
Block a user