-
Notifications
You must be signed in to change notification settings - Fork 854
Move namespace of IServiceCollection.AddOpenTelemetry #4164
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
Move namespace of IServiceCollection.AddOpenTelemetry #4164
Conversation
…tensions.DependencyInjection
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4164 +/- ##
=======================================
Coverage 85.59% 85.59%
=======================================
Files 293 293
Lines 11371 11371
=======================================
Hits 9733 9733
Misses 1638 1638
|
CodeBlanch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't feel passionately that it should be namespace OpenTelemetry so if you feel this is better LGTM
cijothomas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add changelog entry as this is breaking change when bumping from last rc
|
Holding on this until we've settled on some of the questions about where the AddOpenTelemetry API will live... |
|
Handled by #4174 |
We discussed this briefly on a previous PR, but I'm raising it once more because there seems to be conflicting guidance for whether to place extension methods in the namespace of the thing they're extending versus some other namespace.
DO NOT put our extensions under Microsoft.Extensions.* namespace:
https://learn.microsoft.com/dotnet/core/extensions/options-library-authors#namespace-guidance
DO put our extensions under Microsoft.Extensions.* namespace:
https://learn.microsoft.com/dotnet/core/extensions/dependency-injection-usage#register-services-for-di
In general, I don't feel strongly either way. However, we do have an existing precedent for placing our extensions in the namespace of the thing they're extending. So I lean towards us being self-consistent.
ILoggingBuilder extensions
opentelemetry-dotnet/src/OpenTelemetry/Logs/OpenTelemetryLoggingExtensions.cs
Lines 26 to 43 in 1273e83
Prometheus exporter ApplicationBuilder extensions
opentelemetry-dotnet/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusExporterApplicationBuilderExtensions.cs
Lines 24 to 43 in 1273e83