Skip to content

Allows API packages to specify file-based and env-based config#1621

Merged
brettmc merged 9 commits intoopen-telemetry:mainfrom
Nevay:feature/config-api
Jun 16, 2025
Merged

Allows API packages to specify file-based and env-based config#1621
brettmc merged 9 commits intoopen-telemetry:mainfrom
Nevay:feature/config-api

Conversation

@Nevay
Copy link
Copy Markdown
Contributor

@Nevay Nevay commented Jun 4, 2025

Moves ComponentProvider and related classes to API and adds env-based loader to allow API packages (instrumentations and propagators) to specify their configuration options.

Comment thread src/Config/SDK/Configuration/ComponentPlugin.php
@ChrisLightfootWild
Copy link
Copy Markdown
Contributor

Should I base #1523 on the back of this, given the environment changes here? 🤔 (I appreciate that my PR is a little stale, but I plan to pick it up again in future)

@Nevay
Copy link
Copy Markdown
Contributor Author

Nevay commented Jun 11, 2025

The two PRs should be mostly independent:
#1523 changes how OpenTelemetry\SDK\Common\Configuration\Configuration reads values
#1621 changes how values from OpenTelemetry\SDK\Common\Configuration\Configuration are read

@Nevay Nevay marked this pull request as ready for review June 12, 2025 17:56
@Nevay Nevay requested a review from a team as a code owner June 12, 2025 17:56
@ChrisLightfootWild
Copy link
Copy Markdown
Contributor

Failing pipelines look to be related to Xdebug issues that Brett raised in #1554; still present in 3.4.3.

Noted that there is a 3.4.4 to address some issues, but looks like re-running the build hasn't picked up that extension version yet.

Comment thread src/Config/SDK/Configuration/ComponentPlugin.php Outdated
@Nevay Nevay force-pushed the feature/config-api branch from e6c14f8 to 53796a3 Compare June 13, 2025 14:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 12.61261% with 97 lines in your changes missing coverage. Please review.

Project coverage is 68.62%. Comparing base (95229b7) to head (eacc55a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/SDK/Common/Configuration/EnvResolver.php 0.00% 38 Missing ⚠️
...ommon/Configuration/EnvComponentLoaderRegistry.php 0.00% 24 Missing ⚠️
...General/ConfigEnv/EnvComponentLoaderHttpConfig.php 0.00% 13 Missing ⚠️
...General/ConfigEnv/EnvComponentLoaderPeerConfig.php 0.00% 4 Missing ⚠️
src/Config/SDK/Configuration.php 0.00% 4 Missing ⚠️
src/Config/SDK/Instrumentation.php 0.00% 4 Missing ⚠️
src/API/Configuration/Context.php 0.00% 3 Missing ⚠️
src/API/Configuration/Config/ComponentPlugin.php 0.00% 1 Missing ⚠️
src/API/Configuration/Config/ComponentProvider.php 0.00% 1 Missing ⚠️
...Configuration/Config/ComponentProviderRegistry.php 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1621      +/-   ##
============================================
- Coverage     69.39%   68.62%   -0.77%     
- Complexity     2812     2854      +42     
============================================
  Files           414      425      +11     
  Lines          8594     8699     +105     
============================================
+ Hits           5964     5970       +6     
- Misses         2630     2729      +99     
Flag Coverage Δ
8.1 68.42% <12.61%> (-0.74%) ⬇️
8.2 68.57% <12.61%> (-0.72%) ⬇️
8.3 ?
8.4 ?
8.5 68.58% <12.61%> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Config/SDK/ComponentProvider/Detector/Composer.php 0.00% <ø> (ø)
src/Config/SDK/ComponentProvider/Detector/Host.php 0.00% <ø> (ø)
.../Config/SDK/ComponentProvider/Detector/Process.php 0.00% <ø> (ø)
...der/Instrumentation/General/HttpConfigProvider.php 0.00% <ø> (ø)
...der/Instrumentation/General/PeerConfigProvider.php 0.00% <ø> (ø)
...tProvider/InstrumentationConfigurationRegistry.php 0.00% <ø> (ø)
...omponentProvider/Logs/LogRecordExporterConsole.php 0.00% <ø> (ø)
...ComponentProvider/Logs/LogRecordExporterMemory.php 0.00% <ø> (ø)
...mponentProvider/Logs/LogRecordExporterOtlpFile.php 0.00% <ø> (ø)
...mponentProvider/Logs/LogRecordExporterOtlpGrpc.php 0.00% <ø> (ø)
... and 51 more

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95229b7...eacc55a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nevay Nevay force-pushed the feature/config-api branch from 53796a3 to eacc55a Compare June 13, 2025 15:15
@brettmc brettmc merged commit 5451d57 into open-telemetry:main Jun 16, 2025
6 of 9 checks passed
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.

3 participants