Move namespace of IServiceCollection.AddOpenTelemetry#4164
Closed
alanwest wants to merge 4 commits intoopen-telemetry:mainfrom
Closed
Move namespace of IServiceCollection.AddOpenTelemetry#4164alanwest wants to merge 4 commits intoopen-telemetry:mainfrom
alanwest wants to merge 4 commits intoopen-telemetry:mainfrom
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
approved these changes
Feb 7, 2023
Member
CodeBlanch
left a comment
There was a problem hiding this comment.
Don't feel passionately that it should be namespace OpenTelemetry so if you feel this is better LGTM
cijothomas
approved these changes
Feb 8, 2023
Member
cijothomas
left a comment
There was a problem hiding this comment.
Can you add changelog entry as this is breaking change when bumping from last rc
Kielek
approved these changes
Feb 8, 2023
Member
Author
|
Holding on this until we've settled on some of the questions about where the AddOpenTelemetry API will live... |
3 tasks
Member
Author
|
Handled by #4174 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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