Skip to content
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

Conversation

codeboten
Copy link
Contributor

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.

The follow up to this PR is to use the WithObsReport to set the option in various components.

Part of #8804

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]>
@codeboten codeboten requested review from a team and dmitryax November 9, 2023 14:46
@codeboten codeboten marked this pull request as draft November 9, 2023 14:46
@codeboten
Copy link
Contributor Author

Pinging @TylerHelmuth as we talked about this at kubecon

Copy link
Member

@TylerHelmuth TylerHelmuth left a 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)
Copy link
Member

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.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Nov 30, 2023
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (dc28ec1) 91.57% compared to head (d30b691) 91.56%.
Report is 101 commits behind head on main.

Files Patch % Lines
consumer/consumer.go 20.00% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot removed the Stale label Dec 8, 2023
@atoulme atoulme mentioned this pull request Dec 19, 2023
8 tasks
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Dec 22, 2023
Copy link
Contributor

github-actions bot commented Jan 9, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 9, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants