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

[service] Allow users to disable the tracer provider via the feature gate service.noopTracerProvider #10859

Merged

Conversation

codeboten
Copy link
Contributor

Previously the service was returning an instance of a SDK tracer provider regardless of whether there were any processors configured causing resources to be consumed unnecessarily.

Fixes #10858

@codeboten codeboten requested review from a team and songy23 August 12, 2024 20:37
@codeboten codeboten changed the title [service] Ensure a noop tracer provider is returned if no processors are configured [service] Allow users to set a level for the service::telemetry::trace configuration to disable all trace providers Aug 12, 2024
Copy link
Contributor Author

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous approach of using the configured service::telemetry::trace::providers wouldn't work because it would break the default behaviour of the zpages extension.

My suggestion in this PR is to move to a similar model as we will be moving to with metrics, where different meters can be configured for the different levels.

Alternatively, we could break the behaviour of the zpages extension, but that doesn't sound great either

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.65%. Comparing base (06271a6) to head (c3ba15d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10859      +/-   ##
==========================================
+ Coverage   91.64%   91.65%   +0.01%     
==========================================
  Files         406      406              
  Lines       19023    19025       +2     
==========================================
+ Hits        17434    17438       +4     
+ Misses       1228     1227       -1     
+ Partials      361      360       -1     

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

Comment on lines 136 to 138
// - "basic" is the recommended and covers the basics of the service telemetry.
// - "normal" adds some additional spans top of basic.
// - "detailed" adds all available spans to the previous levels.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any of them utilized now?

Also, configtelemetry.Level defaults to Basic. Should we have None by default here?

@codeboten
Copy link
Contributor Author

@dmitryax I'm going to update this PR to use a feature gate as a short term solution for the original issue

@codeboten codeboten marked this pull request as draft August 12, 2024 22:35
@dmitryax
Copy link
Member

dmitryax commented Aug 12, 2024

@dmitryax I'm going to update this PR to use a feature gate as a short term solution for the original issue

Sounds good to me. Maybe we can figure out how to make it work with the zpages extension as a follow-up after the release

…are configured

Previously the service was returning an instance of a SDK tracer provider regardless of whether there were any processors configured causing resources to be consumed unnecessarily.

Fixes open-telemetry#10858

Signed-off-by: Alex Boten <[email protected]>
@codeboten codeboten force-pushed the codeboten/disable-tracer-without-config branch from 4497578 to 5c3c329 Compare August 12, 2024 22:49
@codeboten codeboten marked this pull request as ready for review August 12, 2024 22:49
Signed-off-by: Alex Boten <[email protected]>
@dmitryax dmitryax changed the title [service] Allow users to set a level for the service::telemetry::trace configuration to disable all trace providers [service] Allow users to disable the tracer provider via the feature gate service.noopTracerProvider Aug 12, 2024
@dmitryax dmitryax merged commit 998412c into open-telemetry:main Aug 12, 2024
49 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 12, 2024
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.

Increased request latency discovered in 0.106.1 (> 0.105.0)
3 participants