Skip to main content
Source: Al0075HighCardinalityMetricTagAnalyzer.cs

Description

High-cardinality tags such as user.id, request.id, or url.full create an unbounded number of time series, overwhelming metric storage backends.

Bad Code

counter.Add(1, new("user.id", userId),
               new("request.id", Guid.NewGuid().ToString()));

Good Code

counter.Add(1, new("http.request.method", "GET"),
               new("http.response.status_code", 200));

Properties

  • Category: Metrics
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0075.severity = warning