Skip to content

feat(opentelemetry-configuration): creation of basic ConfigProvider#5809

Merged
pichlermarc merged 20 commits intoopen-telemetry:mainfrom
maryliag:config-provider
Aug 18, 2025
Merged

feat(opentelemetry-configuration): creation of basic ConfigProvider#5809
pichlermarc merged 20 commits intoopen-telemetry:mainfrom
maryliag:config-provider

Conversation

@maryliag
Copy link
Copy Markdown
Contributor

@maryliag maryliag commented Jul 24, 2025

Part of #5626
Solves #5829

  • Creates a basic configuration object with a few attributes. This object is based on configuration spec names and definitions 1. Following PRs will add more attributes
  • Creates a ConfigProvider, that currently only initialize based on environment variables. This will be the component that will also be able to initialize based on a config file in a future PR
  • README is currently very basic, once more concrete functionality is creates, it will get updates
  • Because we will eventually get rid of the core package, I didn't want to create any dependency on it, but I required a few functions related to configuration that were on them, so I copied those files (environment and diagLogLevel), so we can eventually remove them from core and have everything configuration related in the same package

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (5889c66) to head (7bcf23b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5809      +/-   ##
==========================================
+ Coverage   95.01%   95.03%   +0.01%     
==========================================
  Files         303      306       +3     
  Lines        7943     7969      +26     
  Branches     1607     1611       +4     
==========================================
+ Hits         7547     7573      +26     
  Misses        396      396              
Files with missing lines Coverage Δ
.../opentelemetry-configuration/src/ConfigProvider.ts 100.00% <100.00%> (ø)
...try-configuration/src/EnvironmentConfigProvider.ts 100.00% <100.00%> (ø)
...ges/opentelemetry-configuration/src/configModel.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maryliag maryliag marked this pull request as ready for review July 25, 2025 14:10
@maryliag maryliag requested a review from a team as a code owner July 25, 2025 14:10
@maryliag
Copy link
Copy Markdown
Contributor Author

maryliag commented Jul 31, 2025

@pichlermarc as discussed on SIG call, I removed the copy of core functions, and use the ones from core package here instead.
I also noticed you had a question about ConfigProvider itself, and to give more context, I'm using it to follow the spec.

The gist is that we should have a ConfigProvider that will provide the config, and that can be form env or from config file.
Here is more details https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/api.md#configprovider

Copy link
Copy Markdown
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

overall looks very good 🙂
Just a minor questions from my side :)

Comment thread experimental/packages/opentelemetry-configuration/src/utils/diagLogLevel.ts Outdated
Comment thread experimental/packages/opentelemetry-configuration/src/ConfigProvider.ts Outdated
Comment thread experimental/packages/opentelemetry-configuration/test/ConfigProvider.test.ts Outdated
Comment thread experimental/packages/opentelemetry-configuration/package.json Outdated
Comment thread experimental/packages/opentelemetry-configuration/package.json
Comment thread experimental/packages/opentelemetry-configuration/src/configModel.ts Outdated
Comment thread experimental/packages/opentelemetry-configuration/package.json Outdated
@maryliag
Copy link
Copy Markdown
Contributor Author

@pichlermarc is ready for another look, now we have

  • a ConfigProvider interface
  • an implementation for EnvironmentConfigProvider
  • a function to return ConfigProvider: right now is very basic, but this will be the function that we can pass a config file or not, and the function will return the config model based on the file or environment variables

Copy link
Copy Markdown
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

looks good, thank you for working on this : )

Comment thread experimental/packages/opentelemetry-configuration/src/ConfigProvider.ts Outdated
@pichlermarc pichlermarc added this pull request to the merge queue Aug 18, 2025
Merged via the queue into open-telemetry:main with commit 8d0dcea Aug 18, 2025
25 checks passed
@maryliag maryliag deleted the config-provider branch August 18, 2025 15:00
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.

2 participants