Skip to content

[OpenTelemetry] Remove vendored EnvironmentVariablesConfigurationProvider#7146

Open
stevejgordon wants to merge 2 commits into
open-telemetry:mainfrom
stevejgordon:remove-vendored-envvar-config
Open

[OpenTelemetry] Remove vendored EnvironmentVariablesConfigurationProvider#7146
stevejgordon wants to merge 2 commits into
open-telemetry:mainfrom
stevejgordon:remove-vendored-envvar-config

Conversation

@stevejgordon
Copy link
Copy Markdown
Contributor

@stevejgordon stevejgordon commented Apr 23, 2026

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
- Update dependencies to use Microsoft.Extensions.Configuration.EnvironmentVariables.
- Add basic E2E test to validate existing ENV VAR behaviour continues to function.
@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
Copy link
Copy Markdown
Member

@martincostello martincostello left a comment

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
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.64%. Comparing base (bc1fbe6) to head (2bb7937).
⚠️ Report is 68 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.59%   89.64%   +0.05%     
==========================================
  Files         272      272              
  Lines       13376    13376              
==========================================
+ Hits        11984    11991       +7     
+ Misses       1392     1385       -7     
Flag Coverage Δ
unittests-UnstableCoreLibraries-Experimental 40.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file 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
Copy link
Copy Markdown
Member

Kielek commented Apr 30, 2026

@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.

/// </summary>
[CollectionDefinition(Name, DisableParallelization = true)]
#pragma warning disable CA1515 // xUnit1027 requires [CollectionDefinition] classes to be public.
public sealed class EnvVarsCollectionDefinition
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.

@martincostello, as I remember you have implemented scope tools for testing env vars. Can it be used instead of adding collections?

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.

If EnvironmentVariableScope is being used we shouldn't need to use it, unless there's a lot of parallelism going on.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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
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 infra Infra work - CI/CD, code coverage, linters 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

3 participants