Skip to content

Commit

Permalink
Rename GrpcClientInstrumentationOptions to GrpcClientTraceInstrumenta…
Browse files Browse the repository at this point in the history
…tionOptions (open-telemetry#5272)

Co-authored-by: Alan West <[email protected]>
  • Loading branch information
Kielek and alanwest authored Jan 30, 2024
1 parent edc9fe2 commit 52a03b1
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpRequestMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpRequestMessage>
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpRequestMessage.set -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpResponseMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpResponseMessage>
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpResponseMessage.set -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.GrpcClientInstrumentationOptions() -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpRequestMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpRequestMessage>
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpRequestMessage.set -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpResponseMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpResponseMessage>
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpResponseMessage.set -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.GrpcClientTraceInstrumentationOptions() -> void
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void
OpenTelemetry.Trace.TracerProviderBuilderExtensions
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, string name, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, string name, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
Now that this suite of attributes are stable, this instrumentation will only
emit the new attributes.
([#5259](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5259))
* **Breaking Change**: Renamed `GrpcClientInstrumentationOptions` to
`GrpcClientTraceInstrumentationOptions`.
([#5272](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5272))

## 1.6.0-beta.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class GrpcClientInstrumentation : IDisposable
/// Initializes a new instance of the <see cref="GrpcClientInstrumentation"/> class.
/// </summary>
/// <param name="options">Configuration options for Grpc client instrumentation.</param>
public GrpcClientInstrumentation(GrpcClientInstrumentationOptions options = null)
public GrpcClientInstrumentation(GrpcClientTraceInstrumentationOptions options = null)
{
this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new GrpcClientDiagnosticListener(options), isEnabledFilter: null, GrpcInstrumentationEventSource.Log.UnknownErrorProcessingEvent);
this.diagnosticSourceSubscriber.Subscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OpenTelemetry.Instrumentation.GrpcNetClient;
/// <summary>
/// Options for GrpcClient instrumentation.
/// </summary>
public class GrpcClientInstrumentationOptions
public class GrpcClientTraceInstrumentationOptions
{
/// <summary>
/// Gets or sets a value indicating whether down stream instrumentation is suppressed (disabled).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ internal sealed class GrpcClientDiagnosticListener : ListenerHandler
private static readonly PropertyFetcher<HttpRequestMessage> StartRequestFetcher = new("Request");
private static readonly PropertyFetcher<HttpResponseMessage> StopResponseFetcher = new("Response");

private readonly GrpcClientInstrumentationOptions options;
private readonly GrpcClientTraceInstrumentationOptions options;

public GrpcClientDiagnosticListener(GrpcClientInstrumentationOptions options)
public GrpcClientDiagnosticListener(GrpcClientTraceInstrumentationOptions options)
: base("Grpc.Net.Client")
{
this.options = options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ public static TracerProviderBuilder AddGrpcClientInstrumentation(this TracerProv
/// Enables gRPC client instrumentation.
/// </summary>
/// <param name="builder"><see cref="TracerProviderBuilder"/> being configured.</param>
/// <param name="configure">Callback action for configuring <see cref="GrpcClientInstrumentationOptions"/>.</param>
/// <param name="configure">Callback action for configuring <see cref="GrpcClientTraceInstrumentationOptions"/>.</param>
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns>
public static TracerProviderBuilder AddGrpcClientInstrumentation(
this TracerProviderBuilder builder,
Action<GrpcClientInstrumentationOptions> configure)
Action<GrpcClientTraceInstrumentationOptions> configure)
=> AddGrpcClientInstrumentation(builder, name: null, configure);

/// <summary>
/// Enables gRPC client instrumentation.
/// </summary>
/// <param name="builder"><see cref="TracerProviderBuilder"/> being configured.</param>
/// <param name="name">Name which is used when retrieving options.</param>
/// <param name="configure">Callback action for configuring <see cref="GrpcClientInstrumentationOptions"/>.</param>
/// <param name="configure">Callback action for configuring <see cref="GrpcClientTraceInstrumentationOptions"/>.</param>
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns>
public static TracerProviderBuilder AddGrpcClientInstrumentation(
this TracerProviderBuilder builder,
string name,
Action<GrpcClientInstrumentationOptions> configure)
Action<GrpcClientTraceInstrumentationOptions> configure)
{
Guard.ThrowIfNull(builder);

Expand All @@ -60,7 +60,7 @@ public static TracerProviderBuilder AddGrpcClientInstrumentation(

return builder.AddInstrumentation(sp =>
{
var options = sp.GetRequiredService<IOptionsMonitor<GrpcClientInstrumentationOptions>>().Get(name);
var options = sp.GetRequiredService<IOptionsMonitor<GrpcClientTraceInstrumentationOptions>>().Get(name);

return new GrpcClientInstrumentation(options);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ public void AddGrpcClientInstrumentationNamedOptionsSupported()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.ConfigureServices(services =>
{
services.Configure<GrpcClientInstrumentationOptions>(o => defaultExporterOptionsConfigureOptionsInvocations++);
services.Configure<GrpcClientTraceInstrumentationOptions>(o => defaultExporterOptionsConfigureOptionsInvocations++);

services.Configure<GrpcClientInstrumentationOptions>("Instrumentation2", o => namedExporterOptionsConfigureOptionsInvocations++);
services.Configure<GrpcClientTraceInstrumentationOptions>("Instrumentation2", o => namedExporterOptionsConfigureOptionsInvocations++);
})
.AddGrpcClientInstrumentation()
.AddGrpcClientInstrumentation("Instrumentation2", configure: null)
Expand Down

0 comments on commit 52a03b1

Please sign in to comment.