diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 6b8601a7f81..f1ce29e689a 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -41,6 +41,10 @@ exception. The attribute value will be set to full name of exception type. path. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) +* Removed `network.protocol.name` from `http.server.request.duration` metric as + per spec. + ([#5049](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5049)) + ## 1.6.0-beta.2 Released 2023-Oct-26 diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs index 6375d8f7acd..e85536c66e2 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs @@ -188,7 +188,6 @@ public void OnEventWritten_New(string name, object payload) TagList tags = default; // see the spec https://github.com/open-telemetry/semantic-conventions/blob/v1.21.0/docs/http/http-spans.md - tags.Add(new KeyValuePair(SemanticConventions.AttributeNetworkProtocolName, NetworkProtocolName)); tags.Add(new KeyValuePair(SemanticConventions.AttributeNetworkProtocolVersion, HttpTagHelper.GetFlavorTagValueFromProtocol(context.Request.Protocol))); tags.Add(new KeyValuePair(SemanticConventions.AttributeUrlScheme, context.Request.Scheme)); tags.Add(new KeyValuePair(SemanticConventions.AttributeHttpResponseStatusCode, TelemetryHelper.GetBoxedStatusCode(context.Response.StatusCode))); diff --git a/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md index 48fcda3d101..1cf6558302c 100644 --- a/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md @@ -118,6 +118,10 @@ Released 2023-Oct-26 definition. ([#4990](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4990)) +* `dns.lookups.duration` metric is renamed to `dns.lookup.duration`. This change + impacts only users on `.NET8.0` or newer framework. + ([#5049](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5049)) + ## 1.5.1-beta.1 Released 2023-Jul-20 diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs index 0185df65271..e1123b5d49f 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs @@ -242,7 +242,7 @@ public async Task RequestMetricIsCaptured_New(string api, string expectedRoute, expectedRoutes: new List { expectedRoute }, expectedErrorType, expectedStatusCode, - expectedTagsCount: expectedErrorType == null ? 6 : 7); + expectedTagsCount: expectedErrorType == null ? 5 : 6); } [Theory] @@ -440,7 +440,7 @@ public async Task RequestMetricIsCaptured_Dup() expectedRoutes: new List { "api/Values", "api/Values/{id}" }, null, 200, - expectedTagsCount: 6); + expectedTagsCount: 5); } #endif @@ -565,13 +565,8 @@ private static KeyValuePair[] AssertMetricPoint_New( if (expectedErrorType != null) { -#if NET8_0_OR_GREATER - // Expected to change in next release - // https://github.com/dotnet/aspnetcore/issues/51029 - var errorType = new KeyValuePair("exception.type", expectedErrorType); -#else var errorType = new KeyValuePair(SemanticConventions.AttributeErrorType, expectedErrorType); -#endif + Assert.Contains(errorType, attributes); } diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs index c957c14840d..8a57b5c1651 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs @@ -189,8 +189,6 @@ public async Task ValidateNet8MetricsAsync(HttpTestData.HttpOutTestCase tc) meterProvider.Dispose(); } - // dns.lookups.duration is a typo - // https://github.com/dotnet/runtime/issues/92917 var requestMetrics = metrics .Where(metric => metric.Name == "http.client.request.duration" || @@ -198,7 +196,7 @@ public async Task ValidateNet8MetricsAsync(HttpTestData.HttpOutTestCase tc) metric.Name == "http.client.request.time_in_queue" || metric.Name == "http.client.connection.duration" || metric.Name == "http.client.open_connections" || - metric.Name == "dns.lookups.duration") + metric.Name == "dns.lookup.duration") .ToArray(); if (tc.ResponseExpected)