Skip to content

Emit outcome: failure in obsconsumer #13234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jade-guiton-dd
Copy link
Contributor

Description

The last remaining part of #12676 is to implement the outcome: failure part of the Pipeline Component Telemetry RFC (see here). This is done by introducing a downstream error wrapper struct, to distinguish between errors coming from the next component from errors bubbled from further downstream.

Important note

This PR implements things slightly differently from what the text of the RFC describes.

If a pipeline contains components A → B and an error occurs in B, this PR records:

  • otelcol.component.outcome = failure in the otelcol.*.consumed.* metric for B
  • otelcol.component.outcome = refused in the otelcol.*.produced.* metric for A

whereas the RFC would set both outcomes to failure.

This is programmatically simpler — no need to have different behavior between the obsconsumer around the output of A and the one around the input of B — but more importantly, I think it is clearer for users as well: outcome = failure only occurs on metrics associated with the component where the failure actually occurred.

This subtlety wasn't discussed in-depth in #11956 which introduced outcome = refused, so I took the liberty to make this change. If necessary, I can file another RFC amendment to match, or, if there are objections, implement the RFC as-is instead.

Link to tracking issue

Fixes #12676

Testing

I've updated the existing tests in obsconsumer to expect a downstream-wrapped error to exit the obsconsumer layer. I may add more tests later.

Documentation

None.

Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 46.93878% with 26 lines in your changes missing coverage. Please review.

Project coverage is 91.43%. Comparing base (e7b140f) to head (0fa4e93).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
service/internal/obsconsumer/downstream.go 30.00% 11 Missing and 3 partials ⚠️
service/internal/obsconsumer/logs.go 50.00% 1 Missing and 2 partials ⚠️
service/internal/obsconsumer/metrics.go 50.00% 1 Missing and 2 partials ⚠️
service/internal/obsconsumer/profiles.go 50.00% 1 Missing and 2 partials ⚠️
service/internal/obsconsumer/traces.go 50.00% 1 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (46.93%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13234      +/-   ##
==========================================
- Coverage   91.54%   91.43%   -0.11%     
==========================================
  Files         522      523       +1     
  Lines       28955    29029      +74     
==========================================
+ Hits        26508    26544      +36     
- Misses       1931     1954      +23     
- Partials      516      531      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Implement pipeline instrumentation
1 participant