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

Move extensions into owning class namespace & rename add instrumentations ext method #276

Merged
merged 2 commits into from
Sep 26, 2022

Conversation

MikeGoldsmith
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith commented Sep 26, 2022

Which problem is this PR solving?

When providing extensions for classes in other libraries, the expectation is to use the same namespace as this doesn't require consumers to add extra imports.

This PR updates all extension classes to use the same namespace as the class that's being extended. eg TracerProviderBuilder is now in OpenTelemetry.Trace.

It also renames AddAllInstrumentation to AddAutoInstrumentations which is a clearer function name and can't be insinuated that we it will add all possible instrumentation packages instead of ones we've selected.

Short description of the changes

  • Move extensions classes into the same namespace as the class that's being extended.
  • Rename AddAllInstrumentation to AddAutoInstrumentations

@MikeGoldsmith MikeGoldsmith added type: enhancement New feature or request version: bump major A PR that breaks backwards compatibility. labels Sep 26, 2022
@MikeGoldsmith MikeGoldsmith self-assigned this Sep 26, 2022
@MikeGoldsmith MikeGoldsmith requested a review from a team September 26, 2022 10:41
@@ -111,7 +110,7 @@ private static ResourceBuilder AddOSResource(this ResourceBuilder builder)

private static string GetFileVersion()
{
var version = typeof(ResourceBuilderExtensions)
Copy link
Contributor Author

@MikeGoldsmith MikeGoldsmith Sep 26, 2022

Choose a reason for hiding this comment

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

Using a class in another namespace to find this library can lead to conflicts so we're using a class that's in the Honeycomb.OpenTelemetry namespace.

@MikeGoldsmith
Copy link
Contributor Author

MikeGoldsmith commented Sep 26, 2022

FYI build and unit tests are passing, smoke tests are failing in CI. I've opened #277 to track.

@MikeGoldsmith MikeGoldsmith changed the title Move extensions into owning class namespace Move extensions into owning class namespace & rename add instrumentations ext method Sep 26, 2022
@MikeGoldsmith MikeGoldsmith merged commit c023766 into main Sep 26, 2022
@MikeGoldsmith MikeGoldsmith deleted the mike/update-namespaces branch September 26, 2022 19:02
@MikeGoldsmith MikeGoldsmith added this to the GA Release milestone Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request version: bump major A PR that breaks backwards compatibility.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming bikeshed
2 participants