Skip to content

[exporterhelper] Always record send_failed metrics, even with zero value#15645

Open
karan-vk wants to merge 1 commit into
open-telemetry:mainfrom
karan-vk:fix-send-failed-metric-always-recorded
Open

[exporterhelper] Always record send_failed metrics, even with zero value#15645
karan-vk wants to merge 1 commit into
open-telemetry:mainfrom
karan-vk:fix-send-failed-metric-always-recorded

Conversation

@karan-vk

@karan-vk karan-vk commented Jul 24, 2026

Copy link
Copy Markdown

Description

Since #14247, otelcol_exporter_send_failed_* metrics (otelcol_exporter_send_failed_spans, otelcol_exporter_send_failed_metric_points, otelcol_exporter_send_failed_log_records, otelcol_exporter_send_failed_profile_samples) were only recorded when numFailedToSend > 0. As a result, exporters without failing sends stopped reporting these metrics entirely, breaking dashboards, monitors, and alerts expecting continuous metric emission.

This PR restores unconditional recording of otelcol_exporter_send_failed_* metrics with a value of 0 when sends succeed, while maintaining the error.type and error.permanent attributes when numFailedToSend > 0.

Link to tracking issue

Fixes #15568

Testing

Updated unit tests in exporter/exporterhelper/internal/obs_report_sender_test.go (TestExportTraceDataOp, TestExportMetricsOp, TestExportLogsOp, TestExportProfilesOp) as well as exporterhelper tests (logs_test.go, metrics_test.go, traces_test.go) to verify that zero-value send_failed metrics are emitted on successful sends.

Documentation

N/A

Authorship

  • I, a human, wrote this pull request description myself.

Since open-telemetry#14247 the otelcol_exporter_send_failed_* counters were only
recorded when a send failed, so exporters without failures stopped
reporting the metric entirely and dashboards or alerts based on it
broke. Restore unconditional recording so the metric is always present,
while keeping the error.type and error.permanent attributes on failed
sends.

Fixes open-telemetry#15568

Assisted-by: Claude Fable 5
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.

otelcol_exporter_send_failed_metric_points internal metric missing after upgrade from 0.143.0 to 0.156.0

1 participant