-
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
[service] add level for trace configuration #10892
[service] add level for trace configuration #10892
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10892 +/- ##
=======================================
Coverage 91.60% 91.60%
=======================================
Files 404 404
Lines 18990 18990
=======================================
Hits 17395 17395
Misses 1235 1235
Partials 360 360 ☔ View full report in Codecov by Sentry. |
2b0321e
to
7e30f5b
Compare
This allows users to configure a Noop TracerProvider if needed. Note that this configuration option breaks the zpages extension, which relies on a SDK implementation. Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
84d2272
to
0c62d38
Compare
Please, can you elaborate a little bit more on this?
|
The zPages extension registers itself as a span processor to be able to record telemetry about all the spans emitted by the collector. This relies on the code here: opentelemetry-collector/extension/zpagesextension/zpagesextension.go Lines 52 to 58 in d2ed276
That code has always worked with the default configuration because there was no way to disable the tracer provider until the introduction of the feature gate this change is replacing. With a no-op tracer provider, the zpages will be unable to register itself and log the following message: |
Thanks a lot! |
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.
For the sake of consistency with MetricsConfig
I understand why we're using Level
here, but my mind just wants a boolean enabled
option instead. I don't feel strongly enough to block this work.
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.
Some nits, LGTM otherwise
@@ -48,9 +49,10 @@ func attributes(set Settings, cfg Config) map[string]interface{} { | |||
|
|||
// New creates a new Telemetry from Config. | |||
func newTracerProvider(ctx context.Context, set Settings, cfg Config) (trace.TracerProvider, error) { | |||
if globalgates.NoopTracerProvider.IsEnabled() { | |||
if globalgates.NoopTracerProvider.IsEnabled() || cfg.Traces.Level == configtelemetry.LevelNone { |
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.
Should it be documented somewhere that level:none breaks zpage?
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.
I can add a note in the zpages documentation, note that the zpages extension already logs a warning if this happens
This allows users to configure a Noop TracerProvider if needed. Note that this configuration option breaks the zpages extension, which relies on a SDK implementation.
Fixes #10890