Skip to content

Conversation

@codeboten
Copy link
Contributor

@codeboten codeboten commented Oct 30, 2025

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

@codeboten codeboten force-pushed the codeboten/add-init-otel-experimental-config-file branch from 1c48ed5 to 4dec321 Compare November 24, 2025 19:47
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.2%. Comparing base (9d645c3) to head (5d72638).

Additional details and impacted files

Impacted file tree graph

@@          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           
Files with missing lines Coverage Δ
otelconf/config.go 97.6% <100.0%> (+0.4%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codeboten codeboten marked this pull request as ready for review November 24, 2025 19:50
@codeboten codeboten requested review from a team and pellared as code owners November 24, 2025 19:50
@codeboten
Copy link
Contributor Author

Hoping to get some feedback on this before i go through and add unit test coverage

Comment on lines 92 to 95
// Set the global providers.
otel.SetTracerProvider(s.TracerProvider())
otel.SetMeterProvider(s.MeterProvider())
global.SetLoggerProvider(s.LoggerProvider())
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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]>
@codeboten codeboten force-pushed the codeboten/add-init-otel-experimental-config-file branch from 575d3bc to 5d72638 Compare November 27, 2025 17:50
@codeboten
Copy link
Contributor Author

Rebased on top of #8228 to make reviewing easier

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.

otelconf: add support for OTEL_EXPERIMENTAL_CONFIG_FILE variable

2 participants