-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
Add metrics opt-out section to metrics doc #34057
Conversation
Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com>
HTTP requests to an endpoint can be excluded from metrics by adding metadata, with either the [DisableHttpMetrics](xref:Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute) attribute or the [DisableHttpMetrics()](xref:Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions.DisableHttpMetrics<TBuilder>(TBuilder)) method: | ||
|
||
* Add the [DisableHttpMetrics](xref:Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute) attribute to the Web API controller, SignalR hub or gRPC service. | ||
* Call [DisableHttpMetrics()](xref:Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions.DisableHttpMetrics<TBuilder>(TBuilder)) when mapping endpoints in app startup: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tdykstra can you see why attribute works and method doesn't. I vote for replacing link with /dotnet/api/microsoft.aspnetcore.builder.httpmetricsendpointconventionbuilderextensions.disablehttpmetrics
from DisableHttpMetrics
Line 118: [Warning] Cross reference not found: Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions.DisableHttpMetrics<TBuilder>(TBuilder)
.Line 121: [Warning] Cross reference not found:
David Pine's VSC extension provides the right xref link format -- the format for generic methods is complicated. It's using the xref link format now, with custom link text. |
@guardrex FYI I got the broken xref link format from your online tool: https://xrefgen.azurewebsites.net/ If you're still maintaining it then it's something to fix. |
@JamesNK ... It's no longer being maintained. The learn-markdown extension's https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown |
Have you got that to work recently? I believe the docs authoring pack version isn't maintained either anymore because it relies on the same discontinued source for APIs. The tool that does work now is this VS Code extension created in the recent hackathon: https://github.com/IEvangelist/xref-helper/blob/main/README.md |
I haven't checked because I know the pattern (usually) for placing the links. I'll see if I can dig the old PC out and recover the original source for my app. If so, I'll see if I can fix the xrefgen app. I've opened #34107 to remind myself. |
Opting out of metrics was in release notes. This PR adds that content to the ASP.NET Core metrics doc.
Internal previews