-
Notifications
You must be signed in to change notification settings - Fork 302
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
[Instrumentation.AspNet] Add Filter Support For ASP.NET Instrumented Metrics #1426
[Instrumentation.AspNet] Add Filter Support For ASP.NET Instrumented Metrics #1426
Conversation
@ZRich97, could you please review open-telemetry/opentelemetry-dotnet#1407? @ghris created PR few days ago with similar functionality (Enrich). Thanksfor the contribution! |
@Kielek / @vishweshbankwar - Given #1407 was merged as Enrich-only, would it make sense for me to update and publish this PR to enable filtering? I believe there's a valid use case for filtering (mentioned here), but let me know your thoughts. Thanks! |
@ZRich97 What issues do you face if you dont filter out the endpoints you mentioned in #1407 (comment) |
@vishweshbankwar - The main use case in my mind is filtering out unused metrics (noise). Some of our supported services don't need to collect metrics for every route in the application (and they currently don't in their non-OTel monitoring solutions). This filtering could also be done at the alerting/monitoring stage (metrics we don't care about could be identified by the dimensions collected/enriched by this instrumentation and filtered out of any dashboards/alerts), but why not avoid collecting unused metrics altogether? I've updated this PR to only include the Filtering changes I'd already made and better aligned it with the Enrich changes made in #1407. Let me know what you think, and I can add more documentation if this is something that might be supported. Thanks! |
…ps://github.com/ZRich97/opentelemetry-dotnet-contrib into users/zarichar/AspNetMetricsOptionsEnrichFilter
@cijothomas - sure, I'll add our use-case there as well. From what I understand filtering is present for traces, is there a reason it shouldn't also be added for metrics? I would imagine the use-cases would be similar (reduce noise, only monitor certain paths or types of requests, etc.) - let me know if we are missing something. Thanks! |
For traces,logs -every telemetry adds cost - memory cost, serialization costs, network costs, and Vendor billing (typically based on volume). |
@cijothomas - Yep, it makes sense that this would be more important for traces/logs. I don't see a downside to including filtering for metrics as well - is there one from your perspective (or some general guidance against it)? If this PR isn't likely to be merged soon, I can go ahead and close it. For our services to start using the already-merged Enrich() functionality, we'd need a new release of the package. Based on the Contribution Guide, should I create a PR requesting a new release or is there one already planned? |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Fixes open-telemetry/opentelemetry-dotnet#1226
Changes
This PR adds AspNetMetricsInstrumentationOptions with the ability to filter and enrich emitted metrics to the OpenTelemetry.Instrumentation.AspNet package. These changes are meant to match those already available in the AspNetCore instrumentation library and based on this PR: open-telemetry/opentelemetry-dotnet#3948
Our main use case for this functionality is that services can rely on the out-of-the-box instrumentation to emit the "http.server.duration" metric while adding custom tags (in our case these may be "Region", "Cluster", etc.). This would be preferred to building custom handlers and middleware to publish a separate metric with custom tags.
TODO: Documentation and changelog updates.
CHANGELOG.md
updated for non-trivial changes