Skip to content

Commit

Permalink
[ASP.NET Core] Remove suppression for metrics generated from promethe…
Browse files Browse the repository at this point in the history
…us (#5044)
  • Loading branch information
vishweshbankwar authored Nov 13, 2023
1 parent 0bc3bdc commit 78ab35c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 78ab35c

Please sign in to comment.