[ASP.NET Core] Remove suppression for metrics generated from prometheus (#5044)

This commit is contained in:
Vishwesh Bankwar 2023-11-13 13:52:59 -08:00 committed by GitHub
parent 0bc3bdc7ff
commit 78ab35cefd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -35,6 +35,12 @@ 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))
* 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 scraping endpoint that contains `/metrics` in
path.
([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044))
## 1.6.0-beta.2
Released 2023-Oct-26

View File

@ -185,14 +185,6 @@ internal sealed class HttpInMetricsListener : ListenerHandler
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