-
Notifications
You must be signed in to change notification settings - Fork 278
feat: Add compatibility with env OTEL_SDK_DISABLED #1773
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
Changes from all commits
ffac037
0b2653d
3debcde
93d77cb
5a7ae60
3ee1b46
0e69b0e
7bbf5c1
9149624
69bc815
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,11 @@ module SDK | |
| # c.use_all | ||
| # end | ||
| def configure | ||
| if ENV['OTEL_SDK_DISABLED'] == 'true' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @robertlaurin is this the best place for us to check this? Does it make sense to check that in the instance method instead? https://github.com/open-telemetry/opentelemetry-ruby/blob/main/sdk/lib/opentelemetry/sdk/configurator.rb#L144 Do we want to support being able to change the envar and re-initialize in a running program?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here in our applications works like a charm in this place (using monkey patch). The PR content was based on this comment: #1605 (comment)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that was my comment 😄 I reached out to @robertlaurin here since he designed this component and wanted to solicit his input about where this check should happen. If a user is not using the DSL, they can still create an instance of the They could also not use the configurator at all and assemble the tracer provider and resources themselves. I just want to make sure we are hooking this into the appropriate scope, so folks are not surprised that it does not work as anticipated in specific scenarios; or if we are OK with this minimal implementation.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had similar questions @kaylareopelle to the ones you brought up
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you! missed this! (link to comment) |
||
| OpenTelemetry.logger.warn 'Environment variable OTEL_SDK_DISABLED is defined as true. SDK is disabled.' | ||
| return | ||
| end | ||
|
|
||
| configurator = Configurator.new | ||
| yield configurator if block_given? | ||
| configurator.configure | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.