Skip to content

Commit 52a03b1

Browse files
Kielekalanwest
andauthored
Rename GrpcClientInstrumentationOptions to GrpcClientTraceInstrumentationOptions (#5272)
Co-authored-by: Alan West <[email protected]>
1 parent edc9fe2 commit 52a03b1

File tree

7 files changed

+24
-21
lines changed

7 files changed

+24
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions
2-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpRequestMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpRequestMessage>
3-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpRequestMessage.set -> void
4-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpResponseMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpResponseMessage>
5-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.EnrichWithHttpResponseMessage.set -> void
6-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.GrpcClientInstrumentationOptions() -> void
7-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool
8-
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void
1+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions
2+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpRequestMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpRequestMessage>
3+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpRequestMessage.set -> void
4+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpResponseMessage.get -> System.Action<System.Diagnostics.Activity, System.Net.Http.HttpResponseMessage>
5+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.EnrichWithHttpResponseMessage.set -> void
6+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.GrpcClientTraceInstrumentationOptions() -> void
7+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool
8+
OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void
99
OpenTelemetry.Trace.TracerProviderBuilderExtensions
1010
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder
11-
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, string name, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
12-
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
11+
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, string name, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
12+
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddGrpcClientInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions> configure) -> OpenTelemetry.Trace.TracerProviderBuilder

src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
Now that this suite of attributes are stable, this instrumentation will only
1616
emit the new attributes.
1717
([#5259](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5259))
18+
* **Breaking Change**: Renamed `GrpcClientInstrumentationOptions` to
19+
`GrpcClientTraceInstrumentationOptions`.
20+
([#5272](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5272))
1821

1922
## 1.6.0-beta.3
2023

src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal sealed class GrpcClientInstrumentation : IDisposable
1616
/// Initializes a new instance of the <see cref="GrpcClientInstrumentation"/> class.
1717
/// </summary>
1818
/// <param name="options">Configuration options for Grpc client instrumentation.</param>
19-
public GrpcClientInstrumentation(GrpcClientInstrumentationOptions options = null)
19+
public GrpcClientInstrumentation(GrpcClientTraceInstrumentationOptions options = null)
2020
{
2121
this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new GrpcClientDiagnosticListener(options), isEnabledFilter: null, GrpcInstrumentationEventSource.Log.UnknownErrorProcessingEvent);
2222
this.diagnosticSourceSubscriber.Subscribe();

src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentationOptions.cs renamed to src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientTraceInstrumentationOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace OpenTelemetry.Instrumentation.GrpcNetClient;
88
/// <summary>
99
/// Options for GrpcClient instrumentation.
1010
/// </summary>
11-
public class GrpcClientInstrumentationOptions
11+
public class GrpcClientTraceInstrumentationOptions
1212
{
1313
/// <summary>
1414
/// Gets or sets a value indicating whether down stream instrumentation is suppressed (disabled).

src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcClientDiagnosticListener.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ internal sealed class GrpcClientDiagnosticListener : ListenerHandler
2525
private static readonly PropertyFetcher<HttpRequestMessage> StartRequestFetcher = new("Request");
2626
private static readonly PropertyFetcher<HttpResponseMessage> StopResponseFetcher = new("Response");
2727

28-
private readonly GrpcClientInstrumentationOptions options;
28+
private readonly GrpcClientTraceInstrumentationOptions options;
2929

30-
public GrpcClientDiagnosticListener(GrpcClientInstrumentationOptions options)
30+
public GrpcClientDiagnosticListener(GrpcClientTraceInstrumentationOptions options)
3131
: base("Grpc.Net.Client")
3232
{
3333
this.options = options;

src/OpenTelemetry.Instrumentation.GrpcNetClient/TracerProviderBuilderExtensions.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ public static TracerProviderBuilder AddGrpcClientInstrumentation(this TracerProv
2727
/// Enables gRPC client instrumentation.
2828
/// </summary>
2929
/// <param name="builder"><see cref="TracerProviderBuilder"/> being configured.</param>
30-
/// <param name="configure">Callback action for configuring <see cref="GrpcClientInstrumentationOptions"/>.</param>
30+
/// <param name="configure">Callback action for configuring <see cref="GrpcClientTraceInstrumentationOptions"/>.</param>
3131
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns>
3232
public static TracerProviderBuilder AddGrpcClientInstrumentation(
3333
this TracerProviderBuilder builder,
34-
Action<GrpcClientInstrumentationOptions> configure)
34+
Action<GrpcClientTraceInstrumentationOptions> configure)
3535
=> AddGrpcClientInstrumentation(builder, name: null, configure);
3636

3737
/// <summary>
3838
/// Enables gRPC client instrumentation.
3939
/// </summary>
4040
/// <param name="builder"><see cref="TracerProviderBuilder"/> being configured.</param>
4141
/// <param name="name">Name which is used when retrieving options.</param>
42-
/// <param name="configure">Callback action for configuring <see cref="GrpcClientInstrumentationOptions"/>.</param>
42+
/// <param name="configure">Callback action for configuring <see cref="GrpcClientTraceInstrumentationOptions"/>.</param>
4343
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns>
4444
public static TracerProviderBuilder AddGrpcClientInstrumentation(
4545
this TracerProviderBuilder builder,
4646
string name,
47-
Action<GrpcClientInstrumentationOptions> configure)
47+
Action<GrpcClientTraceInstrumentationOptions> configure)
4848
{
4949
Guard.ThrowIfNull(builder);
5050

@@ -60,7 +60,7 @@ public static TracerProviderBuilder AddGrpcClientInstrumentation(
6060

6161
return builder.AddInstrumentation(sp =>
6262
{
63-
var options = sp.GetRequiredService<IOptionsMonitor<GrpcClientInstrumentationOptions>>().Get(name);
63+
var options = sp.GetRequiredService<IOptionsMonitor<GrpcClientTraceInstrumentationOptions>>().Get(name);
6464

6565
return new GrpcClientInstrumentation(options);
6666
});

test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ public void AddGrpcClientInstrumentationNamedOptionsSupported()
413413
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
414414
.ConfigureServices(services =>
415415
{
416-
services.Configure<GrpcClientInstrumentationOptions>(o => defaultExporterOptionsConfigureOptionsInvocations++);
416+
services.Configure<GrpcClientTraceInstrumentationOptions>(o => defaultExporterOptionsConfigureOptionsInvocations++);
417417

418-
services.Configure<GrpcClientInstrumentationOptions>("Instrumentation2", o => namedExporterOptionsConfigureOptionsInvocations++);
418+
services.Configure<GrpcClientTraceInstrumentationOptions>("Instrumentation2", o => namedExporterOptionsConfigureOptionsInvocations++);
419419
})
420420
.AddGrpcClientInstrumentation()
421421
.AddGrpcClientInstrumentation("Instrumentation2", configure: null)

0 commit comments

Comments
 (0)