-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[consumer] add obsreport to consumer #8833
[consumer] add obsreport to consumer #8833
Conversation
This change provides an option to the consumer (WithObsReport) to set an `obsreport` variable, which is used for adding spans at the beginning and end of each consume operation. If the option is not set, a no-op implementation of the ObsReport interface is used. Signed-off-by: Alex Boten <[email protected]>
Pinging @TylerHelmuth as we talked about this at kubecon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so beautiful
fn := func(ctx context.Context, ld plog.Logs) error { | ||
baseImpl.obsreport.StartTracesOp(ctx) | ||
err := consume(ctx, ld) | ||
baseImpl.obsreport.EndTracesOp(ctx, ld.LogRecordCount(), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth looking at open-telemetry/opentelemetry-collector-contrib#29274.
It's arguably a problem with the API here but at least we should capture the count prior to calling ConsumeLogs.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #8833 +/- ##
==========================================
- Coverage 91.57% 91.56% -0.01%
==========================================
Files 316 317 +1
Lines 17147 17176 +29
==========================================
+ Hits 15702 15727 +25
- Misses 1150 1154 +4
Partials 295 295 ☔ View full report in Codecov by Sentry. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
This change provides an option to the consumer (
WithObsReport
) to set anobsreport
variable, which is used for adding spans at the beginning and end of each consume operation. If the option is not set, a no-op implementation of the ObsReport interface is used.The follow up to this PR is to use the
WithObsReport
to set the option in various components.Part of #8804