-
Notifications
You must be signed in to change notification settings - Fork 707
otelconf: add support for OTEL_EXPERIMENTAL_CONFIG_FILE #8106
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
base: main
Are you sure you want to change the base?
otelconf: add support for OTEL_EXPERIMENTAL_CONFIG_FILE #8106
Conversation
1c48ed5 to
4dec321
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8106 +/- ##
=====================================
Coverage 82.1% 82.2%
=====================================
Files 195 195
Lines 13680 13694 +14
=====================================
+ Hits 11243 11257 +14
Misses 2031 2031
Partials 406 406
🚀 New features to boost your workflow:
|
|
Hoping to get some feedback on this before i go through and add unit test coverage |
otelconf/config.go
Outdated
| // Set the global providers. | ||
| otel.SetTracerProvider(s.TracerProvider()) | ||
| otel.SetMeterProvider(s.MeterProvider()) | ||
| global.SetLoggerProvider(s.LoggerProvider()) |
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.
Doing something like this in init will cause side-effects from just importing this package, possibly conflicting with other init.
Why not provide integration with the explicit creation functions similar to what is done in autoprop, autoexport, ... packages that parse the environment variable and return a constructed type?
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.
Updated the code to use this approach as it also aligns with the suggestion in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk.md#via-otel_experimental_config_file
Split off from open-telemetry#8106, updating the tls files to real test files. Signed-off-by: alex boten <[email protected]>
As discussed in open-telemetry#8059, adding an init function to support users passing in a configuration file via the environment variables OTEL_EXPERIMENTAL_CONFIG_FILE. Fixes open-telemetry#8059 Signed-off-by: alex boten <[email protected]>
Signed-off-by: alex boten <[email protected]>
Signed-off-by: alex boten <[email protected]>
Signed-off-by: alex boten <[email protected]>
Signed-off-by: alex boten <[email protected]>
Signed-off-by: alex boten <[email protected]>
Signed-off-by: alex boten <[email protected]>
575d3bc to
5d72638
Compare
|
Rebased on top of #8228 to make reviewing easier |
As discussed in #8059, adding an init function to support users passing in a
configuration file via the environment variables
OTEL_EXPERIMENTAL_CONFIG_FILE.Fixes #8059
This will remain in draft until #8026 is merged