Skip to main content
Source: Al0085InvalidAttributeValueAnalyzer.cs

Description

Span or metric attribute values must conform to the expected format defined by OpenTelemetry semantic conventions (e.g., HTTP methods must be uppercase).

Bad Code

activity?.SetTag("http.request.method", "get"); // should be uppercase

Good Code

activity?.SetTag("http.request.method", "GET");

Properties

  • Category: OpenTelemetry
  • Severity: Error
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0085.severity = error