diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 6e50bf60f8e..d2d2fcbd283 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -5,9 +5,10 @@ * Metrics instrumentation to correctly populate 'http.flavor' tag. (1.1 instead of HTTP/1.1 etc.) ([3379](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3379)) - * Tracing instrumentation to populate 'http.flavor' tag. ([3372](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3372)) +* Tracing instrumentation to populate 'http.schema' tag. +([3392](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3392)) ## 1.0.0-rc9.4 @@ -15,7 +16,6 @@ Released 2022-Jun-03 * Added additional metric dimensions. ([3247](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3247)) - * Removes net5.0 target as .NET 5.0 is going out of support. The package keeps netstandard2.1 target, so it can still be used with .NET5.0 apps. diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs index 8fcf9d6215f..1ff80acc8b2 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs @@ -153,6 +153,7 @@ public override void OnStartActivity(Activity activity, object payload) } activity.SetTag(SemanticConventions.AttributeHttpMethod, request.Method); + activity.SetTag(SemanticConventions.AttributeHttpScheme, request.Scheme); activity.SetTag(SemanticConventions.AttributeHttpTarget, path); activity.SetTag(SemanticConventions.AttributeHttpUrl, GetUri(request)); activity.SetTag(SemanticConventions.AttributeHttpFlavor, HttpTagHelper.GetFlavorTagValueFromProtocol(request.Protocol)); diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs index 81576baf340..156a2be27d1 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/IncomingRequestsCollectionsIsAccordingToTheSpecTests.cs @@ -113,6 +113,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan( Assert.Equal("localhost", activity.GetTagValue(SemanticConventions.AttributeHttpHost)); Assert.Equal("GET", activity.GetTagValue(SemanticConventions.AttributeHttpMethod)); Assert.Equal("1.1", activity.GetTagValue(SemanticConventions.AttributeHttpFlavor)); + Assert.Equal("http", activity.GetTagValue(SemanticConventions.AttributeHttpScheme)); Assert.Equal(urlPath, activity.GetTagValue(SemanticConventions.AttributeHttpTarget)); Assert.Equal($"http://localhost{urlPath}{query}", activity.GetTagValue(SemanticConventions.AttributeHttpUrl)); Assert.Equal(statusCode, activity.GetTagValue(SemanticConventions.AttributeHttpStatusCode)); diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs index 62e544fd2cf..708bab2cdd0 100644 --- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs +++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/InProcessServer.cs @@ -23,9 +23,6 @@ #if NETCOREAPP3_1 using TestApp.AspNetCore._3._1; #endif -#if NET5_0 -using TestApp.AspNetCore._5._0; -#endif #if NET6_0 using TestApp.AspNetCore._6._0; #endif