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

Allow filtering when collecting standard ASP.NET Core request metrics #3324

Closed
nahk-ivanov opened this issue Jun 1, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@nahk-ivanov
Copy link

Feature Request

Is your feature request related to a problem?

When you add ASP.NET core metrics instrumentation (MeterProviderBuilder.AddAspNetCoreInstrumentation()) it will start collecting request metrics (just the duration at this point). While there are no issues with that, and it is exactly what you would want, there could be platform/infrastructure requests that you are not interested in. For example, if you expose health check APIs, then health check endpoint will be constantly queried by your external monitoring software. Hence, right after enabling standard ASP.NET Core metrics instrumentation, you will immediately get hundreds of requests counted.

Describe the solution you'd like:

We already support filtering in the trace instrumentation code path, where custom filter delegate can be applied to determine whether activities for the given request should be traced or not. I'd suggest we use the same configuration for the metrics code path.

Describe alternatives you've considered.

We could perhaps suggest consumers to filter out metrics on the other end, after collection, based on the http.target attribute, but this results in inconsistent APIs between traces and metrics, and it is also beneficial to reduce telemetry traffic by not emitting unnecessary events to begin with.

Additionally, for gRPC health checks currently we don't log http.target (another issue), so it becomes impossible altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants