diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md index 2299a1573a9..51ae981b732 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +* **Breaking Change** : + [SuppressDownstreamInstrumentation](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient#suppressdownstreaminstrumentation) + option will no longer be supported when used with certain versions of + `OpenTelemetry.Instrumentation.Http` package. Check out this + [issue](https://github.com/open-telemetry/opentelemetry-dotnet/issues/5092) + for details and workaround. + ([#5077](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5077)) + ## 1.6.0-beta.3 Released 2023-Nov-17 diff --git a/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md index 2d5b686bfcc..5ef8ca9eb84 100644 --- a/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md @@ -11,6 +11,14 @@ * Update activity DisplayName as per the specification. ([#5078](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5078)) +* Removed reference to `OpenTelemetry` package. This is a **breaking change** + for users relying on + [SuppressDownstreamInstrumentation](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient#suppressdownstreaminstrumentation) + option in `OpenTelemetry.Instrumentation.GrpcNetClient`. For details, check + out this + [issue](https://github.com/open-telemetry/opentelemetry-dotnet/issues/5092). + ([#5077](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5077)) + ## 1.6.0-beta.3 Released 2023-Nov-17 diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs index 30c2b41641d..f0cd19691e2 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs @@ -20,9 +20,7 @@ using System.Net.Http; #endif using System.Runtime.CompilerServices; -using Microsoft.Extensions.Configuration; using OpenTelemetry.Instrumentation.Http.Implementation; -using static OpenTelemetry.Internal.HttpSemanticConventionHelper; namespace OpenTelemetry.Instrumentation.Http; @@ -31,23 +29,6 @@ namespace OpenTelemetry.Instrumentation.Http; /// public class HttpClientInstrumentationOptions { - internal readonly HttpSemanticConvention HttpSemanticConvention; - - /// - /// Initializes a new instance of the class. - /// - public HttpClientInstrumentationOptions() - : this(new ConfigurationBuilder().AddEnvironmentVariables().Build()) - { - } - - internal HttpClientInstrumentationOptions(IConfiguration configuration) - { - Debug.Assert(configuration != null, "configuration was null"); - - this.HttpSemanticConvention = GetSemanticConventionOptIn(configuration); - } - /// /// Gets or sets a filter function that determines whether or not to /// collect telemetry on a per request basis. diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs index fb14e16c87f..f71707b37a5 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs @@ -104,11 +104,6 @@ public void OnStartActivity(Activity activity, object payload) // By this time, samplers have already run and // activity.IsAllDataRequested populated accordingly. - if (Sdk.SuppressInstrumentation) - { - return; - } - if (!TryFetchRequest(payload, out HttpRequestMessage request)) { HttpInstrumentationEventSource.Log.NullPayload(nameof(HttpHandlerDiagnosticListener), nameof(this.OnStartActivity)); diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs index b3d45af15e8..15f6b6c1023 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs @@ -66,11 +66,6 @@ public override void OnEventWritten(string name, object payload) public void OnStopEventWritten(Activity activity, object payload) { - if (Sdk.SuppressInstrumentation) - { - return; - } - if (TryFetchRequest(payload, out HttpRequestMessage request)) { // see the spec https://github.com/open-telemetry/semantic-conventions/blob/v1.23.0/docs/http/http-metrics.md diff --git a/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj b/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj index b9295759edf..32f80e31c21 100644 --- a/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj +++ b/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj @@ -12,24 +12,22 @@ - - - - + - + + diff --git a/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs index f8bb13a615c..cf0863091f0 100644 --- a/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs @@ -72,8 +72,6 @@ public static TracerProviderBuilder AddHttpClientInstrumentation( { services.Configure(name, configureHttpClientInstrumentationOptions); } - - services.RegisterOptionsFactory(configuration => new HttpClientInstrumentationOptions(configuration)); }); #if NETFRAMEWORK diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs index e94ae3ef9e9..53328008bfb 100644 --- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs +++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs @@ -390,7 +390,7 @@ public void GrpcAndHttpClientInstrumentationIsInvoked(bool shouldEnrich) Assert.Equal(shouldEnrich ? "yes" : "no", grpcSpan.Tags.Where(tag => tag.Key == "enrichedWithHttpResponseMessage").FirstOrDefault().Value); } - [Fact] + [Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/5092")] public void GrpcAndHttpClientInstrumentationWithSuppressInstrumentation() { var uri = new Uri($"http://localhost:{this.server.Port}"); @@ -443,7 +443,7 @@ public void GrpcAndHttpClientInstrumentationWithSuppressInstrumentation() Assert.Equal(0, grpcSpan4.GetTagValue(SemanticConventions.AttributeRpcGrpcStatusCode)); } - [Fact] + [Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/5092")] public void GrpcPropagatesContextWithSuppressInstrumentationOptionSetToTrue() { try @@ -586,7 +586,7 @@ public void GrpcDoesNotPropagateContextWithSuppressInstrumentationOptionSetToFal } } - [Fact] + [Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/5092")] public void GrpcClientInstrumentationRespectsSdkSuppressInstrumentation() { try diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs index 0f0b487d5c9..97794e53d54 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs @@ -278,7 +278,7 @@ public async Task InjectsHeadersAsync_CustomFormat() })); } - [Fact] + [Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/5092")] public async Task RespectsSuppress() { try