Skip to content

Commit ed8cf24

Browse files
Apply suggestions from code review
Co-authored-by: Rick Anderson <[email protected]>
1 parent 8a967aa commit ed8cf24

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

aspnetcore/log-mon/metrics/metrics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,27 +107,27 @@ The proceeding example:
107107
* The tag allows requests to be categorized by marketing medium type, which could be useful when analyzing web app traffic.
108108

109109
> [!NOTE]
110-
> Follow the [multi-dimensional metrics](/dotnet/core/diagnostics/metrics-instrumentation#multi-dimensional-metrics) best practices when enriching with custom tags. Too many tags, or tags with an unbound range cause a large combination of tags, which creates many dimensions. Collection tools have a limit on how many dimensions they support for a counter and may start filtering results out to avoid excessive memory usage.
110+
> Follow the [multi-dimensional metrics](/dotnet/core/diagnostics/metrics-instrumentation#multi-dimensional-metrics) best practices when enriching with custom tags. Tags that are too numerous or have an unbound range create many tag combinations, resulting in high dimensions. Collection tools have limits on supported dimensions for a counter and may filter results to prevent excessive memory use.
111111
112112
:::moniker range=">= aspnetcore-9.0"
113113

114114
## Opt-out of HTTP metrics on certain endpoints and requests
115115

116-
Opting out of recording metrics is beneficial for endpoints frequently called by automated systems, such as health checks. Recording metrics for these requests is generally unnecessary. Unwanted telemetry costs resources to collect and store, and can distort results displayed in a telemetry dashboard.
116+
Opting out of recording metrics is beneficial for endpoints frequently called by automated systems, such as health checks. Recording metrics for these requests is generally unnecessary. Unwanted telemetry uses resources to collect and store, and can distort results displayed in a telemetry dashboard.
117117

118-
HTTP requests to an endpoint can be excluded from metrics by adding metadata. Either:
118+
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:
119119

120120
* Add the [DisableHttpMetrics](xref:Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute) attribute to the Web API controller, SignalR hub or gRPC service.
121121
* Call [DisableHttpMetrics()](xref:Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions.DisableHttpMetrics<TBuilder>(TBuilder)) when mapping endpoints in app startup:
122122

123-
:::code language="csharp" source="~/log-mon/metrics/samples/DisableMetrics/Program.cs" id="snippet_1" highlight="5":::
123+
:::code language="csharp" source="~/log-mon/metrics/metrics/samples/DisableMetrics/Program.cs" id="snippet_1" highlight="5":::
124124

125125
Alternatively, the <xref:Microsoft.AspNetCore.Http.Features.IHttpMetricsTagsFeature.MetricsDisabled?displayProperty=nameWithType> property has been added for:
126126

127127
* Advanced scenarios where a request doesn't map to an endpoint.
128128
* Dynamically disabling metrics collection for specific HTTP requests.
129129

130-
:::code language="csharp" source="~/log-mon/metrics/samples/DisableMetrics/Program.cs" id="snippet_2":::
130+
:::code language="csharp" source="~/log-mon/metrics/metrics/samples/DisableMetrics/Program.cs" id="snippet_2":::
131131

132132
:::moniker-end
133133

0 commit comments

Comments
 (0)