fix: address slo-alerts verify findings

Count the first SDK telemetry loss on the loss panel, print pending
moments on every alerts-check step, check the loss panel on a quiet
stand, align two scenarios and the SLI cross-check text with what the
driver verifies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 04:08:13 +03:00
co-authored by Claude Opus 5.5
parent 107fe7f033
commit ef60b47246
11 changed files with 425 additions and 49 deletions
+19 -4
View File
@@ -43,12 +43,17 @@ groups:
# worker и relay — отброшено из-за полной очереди и неудачные отправки.
# Сумма, а не increase(): ряд отказов появляется с первой потерей, у
# метрик Collector нет времени начала — первое значение нового ряда
# целиком рост
# целиком рост. Третья часть — ноль процесса SDK по ряду ёмкости очереди
# span (есть с запуска): ряд суммы начинается с нуля, и rate() панели
# потерь видит первую потерю (verify W1; у Collector ряды
# otelcol_receiver_refused_* есть с нуля с его старта)
- record: telemetry:lost_items:total
expr: >-
sum by (job, instance) ({__name__=~"otelcol_(receiver_refused|exporter_send_failed|exporter_enqueue_failed)_(spans|log_records|metric_points)"})
or
sum by (job, instance) ({__name__=~"otel_sdk_(processor|exporter)_(span|log)_(processed|exported)_total",error_type!=""})
or
sum by (job, instance) (otel_sdk_processor_span_queue_capacity) * 0
# приращения событий SLI за непересекающиеся 5-минутные окна: SLI любого
# окна — отношение сумм, без чтения 7 суток histogram на каждое обновление
@@ -133,11 +138,16 @@ groups:
for: 2m
labels:
severity: warning
# $value у absent() — всегда 1; текущее значение в описании — возраст
# последнего снимка за час (verify S3)
annotations:
summary: The relay queue snapshot is missing
description: >-
There is no queue depth and age snapshot of the relay while the
Collector exporter is up: the relay is stopped or cannot read
Collector exporter is up (last snapshot {{ with query `time() -
max(max_over_time(timestamp(messenger_queue_oldest_age_seconds{job="messenger-relay"})[1h:15s]))`
}}{{ . | first | value | humanizeDuration }} ago{{ else }}more
than an hour ago{{ end }}): the relay is stopped or cannot read
PostgreSQL, and MessengerQueueLagHigh is blind. Runbook:
infra/otel/runbooks/MessengerQueueMetricsMissing.md
runbook_url: infra/otel/runbooks/MessengerQueueMetricsMissing.md
@@ -153,10 +163,15 @@ groups:
severity: warning
annotations:
summary: 'Metrics target {{ $labels.job }} is down'
# $value — up цели (0); рядом — сколько целей правила недоступно
# сейчас (verify S3)
description: >-
Prometheus cannot scrape {{ $labels.job }} ({{ $labels.instance }})
for a minute; with job haproxy the load balancer metrics are missing
and MessengerHighErrorRate is blind. Runbook:
for a minute (up {{ $value }}; targets of the rule down now: {{
with query `count(up{job=~"otel-collector|loki|tempo|haproxy"} ==
0)` }}{{ . | first | value }}{{ else }}0{{ end }}); with job
haproxy the load balancer metrics are missing and
MessengerHighErrorRate is blind. Runbook:
infra/otel/runbooks/TelemetryTargetDown.md
runbook_url: infra/otel/runbooks/TelemetryTargetDown.md
- alert: TelemetryDataLoss