Skip to content

[OpenTelemetry] Remove vendored EnvironmentVariablesConfigurationProvider#7146

Merged
Kielek merged 5 commits into
open-telemetry:mainfrom
stevejgordon:remove-vendored-envvar-config
Jun 24, 2026
Merged

[OpenTelemetry] Remove vendored EnvironmentVariablesConfigurationProvider#7146
Kielek merged 5 commits into
open-telemetry:mainfrom
stevejgordon:remove-vendored-envvar-config

Conversation

@stevejgordon

@stevejgordon stevejgordon commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #7141
Contributes to #6380 as a pre-requisite simplification

Changes

  • Remove vendored EnvironmentVariablesConfigurationProvider.
  • Update dependencies to use Microsoft.Extensions.Configuration.EnvironmentVariables.
  • Add basic E2E test to validate existing ENV VAR behaviour continues to function.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@stevejgordon
stevejgordon requested a review from a team as a code owner April 23, 2026 13:27
@github-actions github-actions Bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package labels Apr 23, 2026
@stevejgordon
stevejgordon force-pushed the remove-vendored-envvar-config branch from adbb557 to 34d71f7 Compare April 23, 2026 13:29
@martincostello martincostello changed the title [Config] Remove vendored EnvironmentVariablesConfigurationProvider [OpenTelemetry] Remove vendored EnvironmentVariablesConfigurationProvider Apr 23, 2026

@martincostello martincostello left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The change seems OK to me from a code perspective, but I defer to the other maintainers for background on why this was done in the first place that might cause issues (e.g. the additional dependencies for opentelemetry-dotnet-instrumentation).

@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.98%. Comparing base (7ef0ebc) to head (bd44b7f).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7146   +/-   ##
=======================================
  Coverage   89.98%   89.98%           
=======================================
  Files         277      277           
  Lines       14622    14642   +20     
=======================================
+ Hits        13157    13176   +19     
- Misses       1465     1466    +1     
Flag Coverage Δ
unittests-Project-Experimental 89.88% <ø> (-0.05%) ⬇️
unittests-Project-Stable 89.91% <ø> (+0.06%) ⬆️
unittests-Solution 89.94% <ø> (-0.03%) ⬇️
unittests-UnstableCoreLibraries-Experimental 48.83% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 12 files with indirect coverage changes

@stevejgordon

Copy link
Copy Markdown
Contributor Author

Yeah if the driver is dependency reduction, then we may need to instead consider if we want a sync mechanism for the vendored code intead. I know the instrumentation team were doing work to improve dependency issues, so this may now be suitable.

@Kielek

Kielek commented Apr 30, 2026

Copy link
Copy Markdown
Member

@open-telemetry/dotnet-instrumentation-approvers perspective:
after changes in 1.15.0 this additional dependency should not be a problem any longer. Even for .NET versions. It will increase a bit the distribution size.

I would not block this change only for AutoInstrumentation.

Comment thread test/OpenTelemetry.Tests/Shared/EnvVarsCollectionDefinition.cs
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions Bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label May 8, 2026
@stevejgordon

Copy link
Copy Markdown
Contributor Author

I can update the tests if we still want to consider this change? I guess we need a final position from the @open-telemetry/dotnet-maintainers on taking this dependency within the SDK.

@github-actions github-actions Bot removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label May 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions Bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label May 20, 2026
@Kielek Kielek removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label May 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions Bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label May 28, 2026
@martincostello

Copy link
Copy Markdown
Member

We discussed this in the SIG just now. We'd like a 👍 from @rajkumar-rangaraj, but so far there's been no dissenting opinions on taking this change.

@alanwest alanwest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I recognize the CI isn't passing at the moment, but giving my 👍 based on conversation during our meeting today.

We were originally hesitant to take a dependency on Microsoft.Extensions.Configuration.EnvironmentVariable package because it leads us further down the slippery slope of taking on even more Microsoft.Extensions.* dependencies. If we had it to do all over again, we probably would have avoided all dependencies for the core SDK on Microsoft.Extensions.* packages.

We should continue to take a conservative approach with respect to dependencies, but I don't see a big issue with adding this one. I'd like to hear @rajkumar-rangaraj's input.

@github-actions github-actions Bot removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label Jun 3, 2026
@rajkumar-rangaraj

Copy link
Copy Markdown
Member

We were originally hesitant to take a dependency on Microsoft.Extensions.Configuration.EnvironmentVariable package because it leads us further down the slippery slope of taking on even more Microsoft.Extensions.* dependencies. If we had it to do all over again, we probably would have avoided all dependencies for the core SDK on Microsoft.Extensions.* packages.

Thanks @alanwest for adding the context here. I'm fine with the current approach.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions Bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Jun 16, 2026
@martincostello martincostello removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label Jun 16, 2026
@stevejgordon

Copy link
Copy Markdown
Contributor Author

I'll update the tests as recommended and rebase ready for a final review and merge

- Update dependencies to use Microsoft.Extensions.Configuration.EnvironmentVariables.
- Add basic E2E test to validate existing ENV VAR behaviour continues to function.
This was referenced Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Documentation related infra Infra work - CI/CD, code coverage, linters pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Remove manually vendored EnvironmentVariablesConfigurationProvider

5 participants