Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[di] Expose a detached MeterProviderBuilder extension on IServiceCollection which may modify services #4517

Merged

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented May 25, 2023

Relates to #4508

Changes

  • Adds an overload to the IServiceCollection.ConfigureOpenTelemetryMeterProvider extension which doesn't require IServiceProvider and allows for IServiceCollection modification.

Public API Changes

namespace OpenTelemetry.Trace
{
   public static class OpenTelemetryDependencyInjectionMetricsServiceCollectionExtensions
   {
+     public static IServiceCollection ConfigureOpenTelemetryMeterProvider(this IServiceCollection services, Action<MeterProviderBuilder> configure) {}
   }
}

Merge requirement checklist

  • CONTRIBUTING guidelines followed (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)

@CodeBlanch CodeBlanch requested a review from a team as a code owner May 25, 2023 17:40
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #4517 (4283bb0) into main (e85bd93) will increase coverage by 0.11%.
The diff coverage is 98.11%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4517      +/-   ##
==========================================
+ Coverage   85.20%   85.32%   +0.11%     
==========================================
  Files         318      319       +1     
  Lines       12620    12634      +14     
==========================================
+ Hits        10753    10780      +27     
+ Misses       1867     1854      -13     
Impacted Files Coverage Δ
...encyInjectionTracingServiceCollectionExtensions.cs 100.00% <ø> (ø)
...s/Metrics/MeterProviderServiceCollectionBuilder.cs 96.66% <96.66%> (ø)
...encyInjectionMetricsServiceCollectionExtensions.cs 100.00% <100.00%> (ø)
...emetry/Metrics/Builder/MeterProviderBuilderBase.cs 97.22% <100.00%> (+2.57%) ⬆️
...lemetry/Trace/Builder/TracerProviderBuilderBase.cs 98.07% <100.00%> (+26.07%) ⬆️

... and 2 files with indirect coverage changes

@CodeBlanch CodeBlanch merged commit ba8fd47 into open-telemetry:main May 31, 2023
29 checks passed
@CodeBlanch CodeBlanch deleted the di-configuremetrics-withservices branch May 31, 2023 19:52
mfogliatto pushed a commit to mfogliatto/opentelemetry-dotnet that referenced this pull request Jun 10, 2023
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.

None yet

3 participants