Opentelemetry-dotnet: AddOpenTelemetryTracerProvider renaming

Created on 28 Aug 2020  路  4Comments  路  Source: open-telemetry/opentelemetry-dotnet

This PR rename extension methods on ServiceCollection from AddOpenTelemetry to AddOpenTelemetryTracerProvider. There were questions about the lengthy name and some alternates were suggested.
https://github.com/open-telemetry/opentelemetry-dotnet/pull/1138

Opening this issue to continue the discussion.

AddOpenTelemetry - is not indicative.. Its unclear if Metrics are added?

AddOpenTelemetryTracing - makes it clear that Tracing is enabled. We can create AddOpenTelemetryMetrics/Logs later. 1 distinct extension method per Observability pillar. (We can still create AddOpenTelemetry method as the "One ring to rule them all", to enable trace/metric/log)

AddOpenTelemetryTracerProvider - This is truly indicating what the method is doing - it adds TracerProvider to DI. But this could be too long.

AddOpenTelemetryTracer - not strictly correct, as we are adding TracerProvider, not tracer.

(I think its important to include the word OpenTelemetry to avoid confusion. Some examples names include services.AddSignalR services.AddNewtonsoftJson() etc.

question

All 4 comments

Not sure people will like this idea (unsure yet if I do), but just putting it out there...

Was there any discussion about leaving the name as AddOpenTelemetry with a plan of extending it to take a MeterProviderBuilder and LogProviderBuilder?

Something like

public static IServiceCollection AddOpenTelemetry(
    this IServiceCollection services,
    Action<TracerProviderBuilder> configureTraces,
    Action<MeterProviderBuilder> configureMetrics, ...)

Sorry, I missed your "one ring to rule them all" comment.

I like AddOpenTelemetryTracing if we also want individual extension methods for the different telemetry types.

I think AddOpenTelemetryTracing is the most concise yet provides a clear indication of what is actually happening 馃憤

I vote for AddOpenTelemetryTracing as well. Some of these renames are getting really long and verbose.

I will do a PR renaming to AddOpenTelemetryTracing as that seems a good balance between "length" and "clarity".

Was this page helpful?
0 / 5 - 0 ratings