Skip to content

feat(monitoring): an alert fires when the otel collector fails to export spans, metrics or logs #1642

Closed

Description

@dan-petty

Friction

Every span the OpenTelemetry collector received since Tempo was deployed (known K1) has been dropped, and no alert fired: no rule covers collector export failures, so trace loss, and any future loss of logs or remote-written metrics through the collector, can last indefinitely and is visible only on a dashboard and in failure log lines. The collector's debug exporter, which #1132 already removes, is no longer the main log cost; the export failures are.

Evidence

Live, read-only, 2026-10-17 around 22:00Z (main = 3dd7fa6):

  • increase(otelcol_exporter_sent_spans{exporter="otlp_grpc/tempo"}[1d]) = 0, send_failed_spans = 14,350, enqueue_failed_spans = 6,338; over 4d, 0 sent and 20,869 failed. otelcol_exporter_queue_size / otelcol_exporter_queue_capacity for otlp_grpc/tempo = 1.0.
  • Loki, collector container, last 1d: 82,435 lines, of which 32,945 match retry_sender, queue_sender or base_exporter ("Sender failed ... sending queue is full" with Go stack traces), and about 7,638 (9%) are debug-exporter lines.
  • Live Prometheus has 25 rules in 5 groups (homelab-gpus, homelab-nodes, homelab-storage, log-and-metric-retention, monitoring-self); none references otelcol_* or tempo. The tempo pod never existed, so TargetDown cannot catch the outage either.
  • The dashboard shows it (k8s/monitoring/dashboards/otel-collector.json:205 spans sent and failed, :342 queue fill); the Prometheus server scrapes the collector directly so failures "stay visible" (k8s/README.md:163,190).

Repo:

Remedy

  1. Tests first: pin the new rules in tests/test_k8s_monitoring_alerting.py as one structural tuple (name, severity, for, labels), and, if a rule uses otelcol_exporter_enqueue_failed_spans, add it to tests/fixtures/metrics/otel-collector.yaml under from_source (exporterhelper obs_report_sender.go at the deployed collector version).
  2. k8s/monitoring/prometheus-values.yaml: add OtelCollectorExportFailing (warning, for: 15m, with the node label like the other rules): sum by (exporter) (increase(otelcol_exporter_send_failed_spans[15m])) > 0, and the same on otelcol_exporter_send_failed_metric_points and _log_records. Add OtelCollectorExportQueueFull: max by (exporter, data_type) (otelcol_exporter_queue_size / otelcol_exporter_queue_capacity) >= 0.9 for 15m.
  3. Add both to the k8s/README.md Alerting table.
    Expect the alert to fire as soon as it lands until the Tempo pod-security fix (K1) deploys, and to notify no one until Alertmanager has a receiver (feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392). File as part of refactor(k8s): the monitoring stack runs on k8s-monitoring and chart features, with no duplicate collection, dead defaults or leftovers #1128's sequence.

Priority: P3. Severity low on its own; it would have surfaced K1 a week earlier.

Proposed design

Problem statement

The OpenTelemetry collector has dropped every span since Tempo deployed, and no alert fired. No rule covers collector export failures, so loss of spans, logs, or remote-written metrics through the collector can last indefinitely. The failure is visible only on a Grafana dashboard and in log lines. This issue adds alert rules that fire when the collector fails to export any data type or when its export queue fills.

Acceptance criteria

  • Criterion 1: Two new alert rules exist in k8s/monitoring/prometheus-values.yaml: OtelCollectorExportFailing (warning, for 15m) and OtelCollectorExportQueueFull (for 15m).
    Verification: Read the alerting_rules.yml section of k8s/monitoring/prometheus-values.yaml and confirm both rule names, severities, and for-durations are present.
  • Criterion 2: OtelCollectorExportFailing uses sum by (exporter) (increase(otelcol_exporter_send_failed_spans[15m])) > 0 and the same expression for _metric_points and _log_records.
    Verification: Inspect the expr field of the OtelCollectorExportFailing rule in prometheus-values.yaml.
  • Criterion 3: OtelCollectorExportQueueFull uses max by (exporter, data_type) (otelcol_exporter_queue_size / otelcol_exporter_queue_capacity) >= 0.9 for 15m.
    Verification: Inspect the expr field of the OtelCollectorExportQueueFull rule in prometheus-values.yaml.
  • Criterion 4: tests/test_k8s_monitoring_alerting.py pins both new rules as structural tuples (name, severity, for, labels).
    Verification: Run pytest tests/test_k8s_monitoring_alerting.py and confirm it passes with the new rules included.
  • Criterion 5: tests/fixtures/metrics/otel-collector.yaml contains every metric referenced by the new rules under from_source.
    Verification: Run pytest tests/test_k8s_monitoring_alerting.py::test_every_alert_rule_selects_only_series_the_stack_serves and confirm it passes.
  • Criterion 6: The k8s/README.md Alerting table lists both new alerts with their trigger condition, for-duration, and severity.
    Verification: Read the Alerting table in k8s/README.md and confirm rows for OtelCollectorExportFailing and OtelCollectorExportQueueFull exist.

Key questions

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/feature. The candidate adds new alerting rules for OpenTelemetry collector export failures.
    • Priority: P3-Low. Severity is low on its own; it would have surfaced K1 a week earlier.
    • Value: High. Prevents silent trace loss and other telemetry data loss with no alert coverage.
    • Effort: Medium. Requires adding new alert rules, updating tests, and modifying documentation.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p3-low
    status/ready
    effort/medium
    value/high
    on Oct 28, 2026
  5. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p3-lowsource/agenttype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions