Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 when the request path contained `/metrics`.
vishweshbankwar marked this conversation as resolved.
Show resolved Hide resolved
([#5044](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5044))

## 1.6.0-beta.2

Released 2023-Oct-26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down