Skip to content

feat(monitoring): alert when the otel collector fails to export spans, metric points or log records - #2565

Merged
dan-petty merged 2 commits into
mainfrom
feat/1642-otel-collector-export-alerts
Oct 29, 2026
Merged

dan-petty merged 2 commits into
mainfrom
feat/1642-otel-collector-export-alerts

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The OpenTelemetry collector dropped every span that it received from the deploy of Tempo until its pod ran, and no alert fired. The failure showed only on the OpenTelemetry Collector dashboard and in the collector's log. A loss of logs or of remote-written metrics through the collector could also last with no alert.

The new alert group otel-collector in k8s/monitoring/prometheus-values.yaml has two rules. Both wait 15 minutes, have the severity warning, and have no node label, because an export failure is the collector's and its pod can move to any node:

  • OtelCollectorExportFailing fires for each exporter whose send_failed count of spans, metric points or log records increased in each 15-minute window. It names the exporter and the signal in data_type (traces, metrics or logs), as the queue gauges do. One failed send stays quiet.
  • OtelCollectorExportQueueFull fires for each exporter queue that stays at 90% or more of its capacity.

tests/fixtures/metrics/otel-collector.yaml is captured again from the deployed collector (contrib 0.161.0, chart 0.175.0). The collector prints a send_failed counter only from the first failed send, so the three send_failed families are under from_source, with their labels from obs_report_sender.go at v0.161.0. The Prometheus server holds the spans and metric-points families from earlier failures, and the collector's documentation at v0.161.0 declares the log-records family.

tests/test_k8s_monitoring_alerting.py pins both rules, checks that each series they select is a family of the capture, and runs promtool test rules on tests/fixtures/prometheus_rules/otel_collector_tests.yaml. The promtool test that ran only the roadmap Service groups now runs every group that has unit tests. The Alerting table in k8s/README.md lists both alerts.

Alertmanager has no receiver until the webhook Secret exists, so the alerts show in Grafana's Alerting view and notify no one until then.

Closes #1642

Change: openspec/changes/archive/2026-10-28-1642-otel-collector-export-alerts/

@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

  • Failing first: before the rules existed, test_the_baseline_rule_set, the two new otel-collector tests and the promtool unit test of the group failed (the group was missing). After the rules, test_the_otel_collector_rules_read_families_of_the_collector_capture failed on otelcol_exporter_send_failed_log_records until the capture had it.
  • uv run pytest over the 9 test files that read prometheus-values.yaml, the collector capture or the promtool fixtures: 346 passed, after the rebase onto origin/main 88 passed in the alerting and dashboard files. The promtool tests ran (promtool on PATH), with none skipped.
  • Mutation check: with the queue threshold at 0.96, the otel-collector promtool unit test failed; restored.
  • uv run devops docs check and uv run devops openspec check pass.

Live evidence, read-only (2026-10-28):

  • The collector pod's /metrics (contrib 0.161.0, 3.5 hours up) prints otelcol_exporter_queue_size and otelcol_exporter_queue_capacity (data_type, exporter) and the sent_* counters, without _total, and no send_failed_* family.
  • Prometheus holds otelcol_exporter_send_failed_spans (otlp_grpc/tempo) and otelcol_exporter_send_failed_metric_points (prometheus_remote_write) from earlier failures.
  • The collector's service.telemetry sets no level, so the failed counters carry no error.* labels.

Pending a person: after Argo CD syncs the merge, read both rules in Grafana's Alerting view (each stays Normal while Tempo, Prometheus and Loki accept the data), and review the diff in tuicr.

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 23:44
…, metric points or log records

The OpenTelemetry collector dropped every span from the deploy of
Tempo until its pod ran, and no alert fired. The new `otel-collector`
group fires two warnings after 15 minutes:

- `OtelCollectorExportFailing`, for each exporter whose failed spans,
  metric points or log records increased in each 15-minute window. It
  names the exporter and the signal in `data_type`.
- `OtelCollectorExportQueueFull`, for each exporter queue that stays at
  90% or more of its capacity.

The collector capture is taken again at contrib 0.161.0, with the three
`send_failed` families, which the collector prints only from the first
failed send, under `from_source`. promtool unit tests cover both rules.
@dan-petty
dan-petty force-pushed the feat/1642-otel-collector-export-alerts branch from 5b21a67 to 6587e43 Compare October 28, 2026 23:56
@dan-petty
dan-petty merged commit 4fc8ff7 into main Oct 29, 2026
17 checks passed
@dan-petty
dan-petty deleted the feat/1642-otel-collector-export-alerts branch October 29, 2026 00:05
dan-petty pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.12.0](v0.11.3...v0.12.0)
(2026-10-29)


### Features

* **ai:** constrain structured replies on the openai and claude
providers ([#2550](#2550))
([4f7390a](4f7390a))
* **argo:** retire the Helm release records of the charts that Argo CD
renders ([#2568](#2568))
([cabfcd4](cabfcd4))
* **k8s:** devops k8s tunnel keeps the cloudflared forward to
k8s.<domain> running
([#2567](#2567))
([f9493fa](f9493fa)),
closes [#1641](#1641)
* **monitoring:** alert when the otel collector fails to export spans,
metric points or log records
([#2565](#2565))
([4fc8ff7](4fc8ff7))
* **telemetry:** the roadmap Service counts its GitHub writes, budget
holds, Firecrawl searches and own deliveries, and caps refine's comments
on one item
([#2556](#2556))
([9819877](9819877)),
closes [#2475](#2475)


### Bug Fixes

* **git:** report a worktree that a run in parallel removed as removed,
not a failed reclaim
([#2557](#2557))
([a556984](a556984)),
closes [#2408](#2408)
* **k8s:** the devops perimeter opens only the collector's OTLP/HTTP
port, 4318
([#2549](#2549))
([d156ce7](d156ce7))
* **sandbox:** devops sandbox logs reads each line with its stream from
a real engine
([#2546](#2546))
([e7216d5](e7216d5)),
closes [#2520](#2520)
* **service:** the webhook route refuses an unsigned or oversized
delivery before it reads the body, and a rate limit guards it
([#2553](#2553))
([40efcd4](40efcd4)),
closes [#2476](#2476)


### Performance Improvements

* **ai:** price a request with one load of the settings
([#2555](#2555))
([5d86538](5d86538)),
closes [#1420](#1420)


### Code Refactoring

* **config:** a default that backs a settings field is read only through
the settings
([#2561](#2561))
([0702d13](0702d13))
* **exceptions:** each exception class declares its error_code and
exit_code ([#2558](#2558))
([410dece](410dece))
* **review:** render the review report from one input, outside the
orchestrator
([#2563](#2563))
([9e73e6d](9e73e6d)),
closes [#1008](#1008)
* **security:** src has no unreviewed Bandit findings, and the gate
scans src at low severity
([#2560](#2560))
([45261dd](45261dd)),
closes [#1538](#1538)
* **security:** the scanners stop looking for mocks, and their tests run
on the scanner fake
([#2551](#2551))
([2b7f37a](2b7f37a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant