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:
@@ -279,11 +279,28 @@ tests:
|
||||
job: messenger-relay
|
||||
exp_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 PostgreSQL, and MessengerQueueLagHigh is blind. Runbook: infra/otel/runbooks/MessengerQueueMetricsMissing.md'
|
||||
# последний снимок — точка 60 с, вычисление — 240 с
|
||||
description: 'There is no queue depth and age snapshot of the relay while the Collector exporter is up (last snapshot 3m 0s ago): 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
|
||||
- eval_time: 6m
|
||||
alertname: MessengerQueueMetricsMissing
|
||||
exp_alerts: []
|
||||
# снимка не было вовсе (за час): описание без возраста
|
||||
- interval: 15s
|
||||
input_series:
|
||||
- series: 'up{job="otel-collector-exporter",instance="otel-collector:8889"}'
|
||||
values: '1x20'
|
||||
alert_rule_test:
|
||||
- eval_time: 3m
|
||||
alertname: MessengerQueueMetricsMissing
|
||||
exp_alerts:
|
||||
- exp_labels:
|
||||
severity: warning
|
||||
job: messenger-relay
|
||||
exp_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 (last snapshot more than an hour ago): 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
|
||||
# экспортёр Collector недоступен: снимка нет, но молчит (TelemetryTargetDown)
|
||||
- interval: 15s
|
||||
input_series:
|
||||
@@ -333,11 +350,41 @@ tests:
|
||||
instance: tempo:3200
|
||||
exp_annotations:
|
||||
summary: Metrics target tempo is down
|
||||
description: 'Prometheus cannot scrape tempo (tempo:3200) for a minute; with job haproxy the load balancer metrics are missing and MessengerHighErrorRate is blind. Runbook: infra/otel/runbooks/TelemetryTargetDown.md'
|
||||
# Loki к 2 мин вернулся: недоступна одна цель
|
||||
description: 'Prometheus cannot scrape tempo (tempo:3200) for a minute (up 0; targets of the rule down now: 1); 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
|
||||
- eval_time: 5m
|
||||
alertname: TelemetryTargetDown
|
||||
exp_alerts: []
|
||||
# Loki и Tempo недоступны вместе: по оповещению на цель, недоступны две
|
||||
- interval: 15s
|
||||
input_series:
|
||||
- series: 'up{job="tempo",instance="tempo:3200"}'
|
||||
values: '1x3 0x20'
|
||||
- series: 'up{job="loki",instance="loki:3100"}'
|
||||
values: '1x3 0x20'
|
||||
- series: 'up{job="haproxy",instance="haproxy:8404"}'
|
||||
values: '1x23'
|
||||
alert_rule_test:
|
||||
- eval_time: 3m
|
||||
alertname: TelemetryTargetDown
|
||||
exp_alerts:
|
||||
- exp_labels:
|
||||
severity: warning
|
||||
job: loki
|
||||
instance: loki:3100
|
||||
exp_annotations:
|
||||
summary: Metrics target loki is down
|
||||
description: 'Prometheus cannot scrape loki (loki:3100) for a minute (up 0; targets of the rule down now: 2); 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
|
||||
- exp_labels:
|
||||
severity: warning
|
||||
job: tempo
|
||||
instance: tempo:3200
|
||||
exp_annotations:
|
||||
summary: Metrics target tempo is down
|
||||
description: 'Prometheus cannot scrape tempo (tempo:3200) for a minute (up 0; targets of the rule down now: 2); 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
|
||||
|
||||
# --- TelemetryDataLoss и сумма потерь -------------------------------------
|
||||
# Collector: ряд отказов очереди Tempo появился на шаге 9 (135 с) сразу со
|
||||
@@ -410,6 +457,52 @@ tests:
|
||||
- eval_time: 11m
|
||||
alertname: TelemetryDataLoss
|
||||
exp_alerts: []
|
||||
# первая потеря процесса SDK видна в increase() панели потерь (verify W1):
|
||||
# ряд ёмкости очереди span есть с запуска процесса — ряд суммы с нуля; ряд
|
||||
# отказов реплики появился на шаге 16 (240 с) сразу со значением 36. relay
|
||||
# без потерь — ноль, оповещения нет
|
||||
- interval: 15s
|
||||
input_series:
|
||||
- series: 'otel_sdk_processor_span_queue_capacity{job="messenger-api",instance="a1",otel_component_type="batching_span_processor",otel_component_name="batching_span_processor/0"}'
|
||||
values: '2048x40'
|
||||
- series: 'otel_sdk_processor_span_queue_capacity{job="messenger-relay",instance="r1",otel_component_type="batching_span_processor",otel_component_name="batching_span_processor/0"}'
|
||||
values: '2048x40'
|
||||
- series: 'otel_sdk_processor_span_processed_total{job="messenger-api",instance="a1",otel_component_type="batching_span_processor",otel_component_name="batching_span_processor/0"}'
|
||||
values: '0+100x40'
|
||||
- series: 'otel_sdk_processor_span_processed_total{job="messenger-api",instance="a1",otel_component_type="batching_span_processor",otel_component_name="batching_span_processor/0",error_type="queue_full"}'
|
||||
values: '_x16 36x24'
|
||||
promql_expr_test:
|
||||
- expr: telemetry:lost_items:total
|
||||
eval_time: 3m
|
||||
exp_samples:
|
||||
- labels: 'telemetry:lost_items:total{job="messenger-api",instance="a1"}'
|
||||
value: 0
|
||||
- labels: 'telemetry:lost_items:total{job="messenger-relay",instance="r1"}'
|
||||
value: 0
|
||||
# запрос A панели 40 без суммы по job: приращение за 5 мин — вся потеря
|
||||
- expr: increase(telemetry:lost_items:total[5m])
|
||||
eval_time: 6m
|
||||
exp_samples:
|
||||
- labels: '{job="messenger-api",instance="a1"}'
|
||||
value: 36
|
||||
- labels: '{job="messenger-relay",instance="r1"}'
|
||||
value: 0
|
||||
alert_rule_test:
|
||||
- eval_time: 5m
|
||||
alertname: TelemetryDataLoss
|
||||
exp_alerts:
|
||||
- exp_labels:
|
||||
severity: warning
|
||||
job: messenger-api
|
||||
instance: a1
|
||||
exp_annotations:
|
||||
summary: Telemetry of messenger-api is being lost
|
||||
description: 'messenger-api (a1) lost 36 spans, log records or metric points in the last 2 minutes (full queue, failed export or refused by the memory limiter). Runbook: infra/otel/runbooks/TelemetryDataLoss.md'
|
||||
runbook_url: infra/otel/runbooks/TelemetryDataLoss.md
|
||||
- eval_time: 9m
|
||||
alertname: TelemetryDataLoss
|
||||
exp_alerts: []
|
||||
|
||||
# без потерь — тихо, сумма потерь пуста
|
||||
- interval: 15s
|
||||
input_series:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user