Lab7: HTTPS, mTLS, OpenBao, трек 2 PKI на оценку 5
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
groups:
|
||||
- name: messenger-slo
|
||||
rules:
|
||||
- record: messenger:http_requests:rate5m
|
||||
expr: sum(rate(messenger_http_requests_total{http_route!~"/health/.*"}[5m])) or vector(0)
|
||||
- record: messenger:http_5xx:rate5m
|
||||
expr: sum(rate(messenger_http_requests_total{http_response_status_class="5xx",http_route!~"/health/.*"}[5m])) or vector(0)
|
||||
- record: messenger:http_error_ratio:5m
|
||||
expr: |
|
||||
(
|
||||
messenger:http_5xx:rate5m
|
||||
/
|
||||
clamp_min(messenger:http_requests:rate5m, 0.001)
|
||||
)
|
||||
- record: messenger:http_requests:rate30m
|
||||
expr: sum(rate(messenger_http_requests_total{http_route!~"/health/.*"}[30m])) or vector(0)
|
||||
- record: messenger:http_5xx:rate30m
|
||||
expr: sum(rate(messenger_http_requests_total{http_response_status_class="5xx",http_route!~"/health/.*"}[30m])) or vector(0)
|
||||
- record: messenger:http_error_ratio:30m
|
||||
expr: |
|
||||
(
|
||||
messenger:http_5xx:rate30m
|
||||
/
|
||||
clamp_min(messenger:http_requests:rate30m, 0.001)
|
||||
)
|
||||
- record: messenger:http_requests:rate1h
|
||||
expr: sum(rate(messenger_http_requests_total{http_route!~"/health/.*"}[1h])) or vector(0)
|
||||
- record: messenger:http_5xx:rate1h
|
||||
expr: sum(rate(messenger_http_requests_total{http_response_status_class="5xx",http_route!~"/health/.*"}[1h])) or vector(0)
|
||||
- record: messenger:http_error_ratio:1h
|
||||
expr: |
|
||||
(
|
||||
messenger:http_5xx:rate1h
|
||||
/
|
||||
clamp_min(messenger:http_requests:rate1h, 0.001)
|
||||
)
|
||||
|
||||
- name: messenger-alerts
|
||||
rules:
|
||||
- alert: HighHttpErrorRate
|
||||
expr: messenger:http_error_ratio:5m > 0.05
|
||||
for: 1m
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: "Доля HTTP 5xx выше 5% за 5 минут"
|
||||
description: "Текущая доля {{ $value | humanizePercentage }}. Runbook: evidence/runbooks/high-error-rate.md"
|
||||
runbook_url: "evidence/runbooks/high-error-rate.md"
|
||||
|
||||
- alert: GrowingQueueLag
|
||||
expr: max(messenger_queue_oldest_job_age_seconds{messaging_destination_name="attachments.process"}) > 30
|
||||
for: 30s
|
||||
labels:
|
||||
severity: ticket
|
||||
annotations:
|
||||
summary: "Возраст старейшей job в attachments.process выше 30 с"
|
||||
description: "Возраст {{ $value }} с. Runbook: evidence/runbooks/queue-lag.md"
|
||||
runbook_url: "evidence/runbooks/queue-lag.md"
|
||||
|
||||
- alert: ErrorBudgetBurnFast
|
||||
expr: |
|
||||
(
|
||||
messenger:http_error_ratio:5m > (14.4 * 0.01)
|
||||
and
|
||||
messenger:http_error_ratio:30m > (14.4 * 0.01)
|
||||
)
|
||||
for: 2m
|
||||
labels:
|
||||
severity: page
|
||||
burn_window: fast
|
||||
annotations:
|
||||
summary: "Быстрый burn rate ошибки SLO (14.4x на 5м и 30м)"
|
||||
description: "Кратковременный всплеск 5xx. Runbook: evidence/runbooks/burn-rate.md"
|
||||
runbook_url: "evidence/runbooks/burn-rate.md"
|
||||
|
||||
- alert: ErrorBudgetBurnSlow
|
||||
expr: |
|
||||
(
|
||||
messenger:http_error_ratio:30m > (6 * 0.01)
|
||||
)
|
||||
for: 5m
|
||||
labels:
|
||||
severity: ticket
|
||||
burn_window: slow
|
||||
annotations:
|
||||
summary: "Медленный burn rate ошибки SLO (6x на 30м)"
|
||||
description: "Длительная деградация. Runbook: evidence/runbooks/burn-rate.md"
|
||||
runbook_url: "evidence/runbooks/burn-rate.md"
|
||||
@@ -0,0 +1,18 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
rule_files:
|
||||
- /etc/prometheus/alerts.yml
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
- job_name: otel-collector
|
||||
static_configs:
|
||||
- targets: ["otel-collector:8888"]
|
||||
- job_name: messenger-otel
|
||||
metrics_path: /metrics
|
||||
static_configs:
|
||||
- targets: ["otel-collector:8889"]
|
||||
Reference in New Issue
Block a user