Issue that does not fit into other categories
What are you trying to achieve?
Each resource detector package today has a unique namespace. This results in substantial noise when including multiple detectors in a project, a situation which is fairly common.
Here is an example of a recent change on one of our projects:

This also goes against the design of other components such as instrumentations and exporters, which follow the main namespaces of their respective metric type. Eg:
|
namespace OpenTelemetry.Metrics; |
|
|
|
/// <summary> |
|
/// Extension methods to simplify registering of ASP.NET request instrumentation. |
|
/// </summary> |
|
public static class MeterProviderBuilderExtensions |
|
{ |
|
/// <summary> |
|
/// Enables the incoming requests automatic data collection for ASP.NET. |
|
/// </summary> |
|
/// <param name="builder"><see cref="MeterProviderBuilder"/> being configured.</param> |
|
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns> |
|
public static MeterProviderBuilder AddAspNetInstrumentation(this MeterProviderBuilder builder) => |
The main difference between these 2 is that detectors don't come with custom extension methods on ResourceBuilder, while other components are usually added via extensions on TracerProviderBuilder and MeterProviderBuilder.
What do you expect to see?
I'd like to see one of 3 approaches here:
- Have all
OpenTelemetry.ResourceDetectors.* packages have a root namespace of OpenTelemetry.ResourceDetectors
- Have all
OpenTelemetry.ResourceDetectors.* packages have a root namespace of OpenTelemetry.Resources
- Have all
OpenTelemetry.ResourceDetectors.* packages provide .Add{detector_name}Detector extension methods on top of ResourceBuilder and targeting namespace OpenTelemetry.Resources
From a consistency standpoint, I believe 3 would be the best as it stands today. After that, I like 2 as it doesn't introduce a new namespace, and then 3 as it at least unifies all of them in a single namespace.
The caveat with 2 and 1 is that they would potentially also apply to all other projects in a similar way, so it would make sense to apply them more broadly than just for Resource Detector packages.
Additionally, opting for 2 could prompt a different naming scheme altogether which I think would be more fitting, from "ResourceDetector" to just "Resources":
OpenTelemetry.ResourceDetectors.Host -> OpenTelemetry.Resources.Host
Additional context.
I believe the current approach is extremely noisy and won't scale well as even more detectors are introduced. Additionally, even without regard to the noise issue, I dislike very granular namespaces like this and am fond of the pattern of "child" assemblies NOT including the last segment of the assembly name in the final namespace. This is a common approach in many libraries, for example
Microsoft.Extensions.DependencyInjection vs Microsoft.Extensions.DependencyInjection.Abstractions, where the "Abstractions" in the assembly name does not participate in the final namespace of the classes inside:

Issue that does not fit into other categories
What are you trying to achieve?
Each resource detector package today has a unique namespace. This results in substantial noise when including multiple detectors in a project, a situation which is fairly common.
Here is an example of a recent change on one of our projects:

This also goes against the design of other components such as instrumentations and exporters, which follow the main namespaces of their respective metric type. Eg:
opentelemetry-dotnet-contrib/src/OpenTelemetry.Instrumentation.AspNet/MeterProviderBuilderExtensions.cs
Lines 8 to 20 in 01c2257
The main difference between these 2 is that detectors don't come with custom extension methods on
ResourceBuilder, while other components are usually added via extensions onTracerProviderBuilderandMeterProviderBuilder.What do you expect to see?
I'd like to see one of 3 approaches here:
OpenTelemetry.ResourceDetectors.*packages have a root namespace ofOpenTelemetry.ResourceDetectorsOpenTelemetry.ResourceDetectors.*packages have a root namespace ofOpenTelemetry.ResourcesOpenTelemetry.ResourceDetectors.*packages provide.Add{detector_name}Detectorextension methods on top ofResourceBuilderand targeting namespaceOpenTelemetry.ResourcesFrom a consistency standpoint, I believe 3 would be the best as it stands today. After that, I like 2 as it doesn't introduce a new namespace, and then 3 as it at least unifies all of them in a single namespace.
The caveat with 2 and 1 is that they would potentially also apply to all other projects in a similar way, so it would make sense to apply them more broadly than just for Resource Detector packages.
Additionally, opting for 2 could prompt a different naming scheme altogether which I think would be more fitting, from "ResourceDetector" to just "Resources":
OpenTelemetry.ResourceDetectors.Host->OpenTelemetry.Resources.HostAdditional context.
I believe the current approach is extremely noisy and won't scale well as even more detectors are introduced. Additionally, even without regard to the noise issue, I dislike very granular namespaces like this and am fond of the pattern of "child" assemblies NOT including the last segment of the assembly name in the final namespace. This is a common approach in many libraries, for example
Microsoft.Extensions.DependencyInjectionvsMicrosoft.Extensions.DependencyInjection.Abstractions, where the "Abstractions" in the assembly name does not participate in the final namespace of the classes inside: