-
Notifications
You must be signed in to change notification settings - Fork 283
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
Filter support for ASP.NET Core metrics #1765
Comments
Adding comment from discussion on #1426:
Metric-level filters seem like the best way to reduce possible noise and collect metrics only for the routes/requests service owners are most interested in. Is there another OTel construct or tool aside from the Instrumentation packages that would fill the same role in its absence? Is there any downside to having filter options available? Our team is starting to move towards OTel across our .NET services. If there is a better approach we'd be interested in trying it out as well. Thanks! |
Please bring filtering back. As it was mentioned above, one use case is to reduce noise caused by healthchecks |
I really don't understand the reason behind removing already implemented features. Performance or allocation? Even if so, that's a tradeoff which should be considered by the consumer. IMHO, Enrich and Filter should be de facto for all instrumentations. We operate many microservices, each with multiple instances, within the Kubernetes environment. As you may know, it's best practice to use liveness and readiness probes for health check in K8s. However, it's worth noting that they contribute to increased metric noise. // Should be filtered
/health/live
/health/ready
/metrics |
We filter out a lot of health checks, version checks and a couple of internal controllers that are already kept track of in another way. Or for requests that result is very high cardinality. This reduces the total amount of noise in our metrics systems. And the additional load is negligible for us at least, our requests are quite heavy. |
We also exclude k8s health checks or favicon.ico, robots.txt etc, it's very useful feature. |
Adding my vote here for filtering out routes for health checks.
Basically, lack of this feature drives up cost of operations for the system, and the consumer should be able to choose which costs are bearable and which are not. |
Also hoping to see the feature, while think it may be better to support from the .NET API so that the metrics we do not care would not be produced also link to an issue in dotnet/aspnetcore dotnet/aspnetcore#50654 |
We are looking forward to this coming back. There's a lot of extra in our exposed metrics right now ( |
Any update on this issue? |
by adding OpenTelemetry.Instrumentation.AspNetCore
i think this will resolve my problem. not tested yet but seems bright enough |
Thanks everyone for the feedback - The feature is requested for .NET9.0. Please track dotnet/aspnetcore#50654 for updates. |
It appears we need to wait for this fundamental feature until the .NET 9 release. Most of our customers only upgrade to LTS versions, which means we likely have to wait until .NET 10 or 11. Splendid! |
I solved this in my otel collector configuration using the filter processor: filter/ottl:
error_mode: ignore
traces:
span:
- attributes["url.path"] == "/metrics" remark that I updated my configuration to match your example, not sure about the real url path. |
Some pre-release versions of Metrics instrumentation provided support for filtering out measurements for
http.server.request.duration
. This option is removed in open-telemetry/opentelemetry-dotnet#4981 and is not available in any of the supported .NET versions.Please share your feedback here in case you are affected by this change. Explain your scenario in detail as to why this feature is needed.
The text was updated successfully, but these errors were encountered: