From f0178be56d6f9323f27936b0be9a7ca54844b304 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Mon, 13 Nov 2023 08:33:22 -0800 Subject: [PATCH 1/8] Remove supression for prometheus --- .../Implementation/HttpInMetricsListener.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs index 5d8db405158..6375d8f7acd 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs @@ -185,14 +185,6 @@ public void OnEventWritten_New(string name, object payload) return; } - // TODO: Prometheus pulls metrics by invoking the /metrics endpoint. Decide if it makes sense to suppress this. - // Below is just a temporary way of achieving this suppression for metrics (we should consider suppressing traces too). - // If we want to suppress activity from Prometheus then we should use SuppressInstrumentationScope. - if (context.Request.Path.HasValue && context.Request.Path.Value.Contains("metrics")) - { - return; - } - TagList tags = default; // see the spec https://github.com/open-telemetry/semantic-conventions/blob/v1.21.0/docs/http/http-spans.md From f589556398ed671aafe654f17deb0ab767fac8d9 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Mon, 13 Nov 2023 08:36:28 -0800 Subject: [PATCH 2/8] add changelog --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 15e4180b1b3..9e4a6d3564a 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -35,6 +35,9 @@ exception. The attribute value will be set to full name of exception type. * Fixed `network.protocol.version` attribute values to match the specification. ([#5007](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5007)) +* Removed filtering of metrics generated as a result of pull from Prometheus. + ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) + ## 1.6.0-beta.2 Released 2023-Oct-26 From 50108516c5a932babf11a75454719e1d1795a951 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Mon, 13 Nov 2023 09:58:09 -0800 Subject: [PATCH 3/8] reword --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 9e4a6d3564a..986771187db 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -35,7 +35,7 @@ exception. The attribute value will be set to full name of exception type. * Fixed `network.protocol.version` attribute values to match the specification. ([#5007](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5007)) -* Removed filtering of metrics generated as a result of pull from Prometheus. +* Removed filtering of metrics when the request path contained `/metrics`. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) ## 1.6.0-beta.2 From 79718f2a7a9e8e893e5321654548abd1a7b7cdc6 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Mon, 13 Nov 2023 11:05:14 -0800 Subject: [PATCH 4/8] reword --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 986771187db..476632a0a60 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -35,7 +35,9 @@ exception. The attribute value will be set to full name of exception type. * Fixed `network.protocol.version` attribute values to match the specification. ([#5007](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5007)) -* Removed filtering of metrics when the request path contained `/metrics`. +* Removed filtering of metrics when the request path contained `/metrics`. This + change may affect prometheus pull scenario if the prometheus server sends + request to the scrapping endpoint that contains `/metrics` in path. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) ## 1.6.0-beta.2 From d42f5ec28e675a80c6a99179bcb55b3d8d61b827 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Mon, 13 Nov 2023 11:36:01 -0800 Subject: [PATCH 5/8] reword --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 476632a0a60..35ce49618b5 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -35,9 +35,10 @@ exception. The attribute value will be set to full name of exception type. * Fixed `network.protocol.version` attribute values to match the specification. ([#5007](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5007)) -* Removed filtering of metrics when the request path contained `/metrics`. This - change may affect prometheus pull scenario if the prometheus server sends - request to the scrapping endpoint that contains `/metrics` in path. +* Removed exclusion of measurements from `http.server.request.duration` metric + when the request path contained `/metrics`. This change may affect prometheus + pull scenario if the prometheus server sends request to the scrapping endpoint + that contains `/metrics` in path. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) ## 1.6.0-beta.2 From 5ead46ad3154713a8a8f9326c5b5224a7836391f Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:22:49 -0800 Subject: [PATCH 6/8] Update src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 35ce49618b5..0bd977ddca0 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -37,7 +37,7 @@ exception. The attribute value will be set to full name of exception type. * Removed exclusion of measurements from `http.server.request.duration` metric when the request path contained `/metrics`. This change may affect prometheus - pull scenario if the prometheus server sends request to the scrapping endpoint + pull scenario if the Prometheus server sends request to the scraping endpoint that contains `/metrics` in path. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) From 91646beb284bef918d33cc7139e7e91bbe469130 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:22:54 -0800 Subject: [PATCH 7/8] Update src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 0bd977ddca0..8900c5c135e 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -36,7 +36,7 @@ exception. The attribute value will be set to full name of exception type. ([#5007](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5007)) * Removed exclusion of measurements from `http.server.request.duration` metric - when the request path contained `/metrics`. This change may affect prometheus + when the request path contained `/metrics`. This change may affect Prometheus pull scenario if the Prometheus server sends request to the scraping endpoint that contains `/metrics` in path. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) From 5d3183a3c553e97c27e203b09146f8a86e71928d Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Mon, 13 Nov 2023 13:04:06 -0800 Subject: [PATCH 8/8] feedback --- src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md index 35ce49618b5..4e351501d4c 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md @@ -35,10 +35,10 @@ exception. The attribute value will be set to full name of exception type. * Fixed `network.protocol.version` attribute values to match the specification. ([#5007](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5007)) -* Removed exclusion of measurements from `http.server.request.duration` metric - when the request path contained `/metrics`. This change may affect prometheus - pull scenario if the prometheus server sends request to the scrapping endpoint - that contains `/metrics` in path. +* Calls to `/metrics` will now be included in the `http.server.request.duration` + metric. This change may affect prometheus pull scenario if the prometheus + server sends request to the scrapping endpoint that contains `/metrics` in + path. ([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044)) ## 1.6.0-beta.2