[exporterhelper] Always record send_failed metrics, even with zero value#15645
Open
karan-vk wants to merge 1 commit into
Open
[exporterhelper] Always record send_failed metrics, even with zero value#15645karan-vk wants to merge 1 commit into
karan-vk wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whennumFailedToSend > 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 of0when sends succeed, while maintaining theerror.typeanderror.permanentattributes whennumFailedToSend > 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 asexporterhelpertests (logs_test.go,metrics_test.go,traces_test.go) to verify that zero-valuesend_failedmetrics are emitted on successful sends.Documentation
N/A
Authorship