Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ancplua.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Source: Al0086IncorrectAttributeTypeAnalyzer.cs

Description

OpenTelemetry attributes should use the correct value types as defined by semantic conventions. Using a string where an int is expected degrades query performance.

Bad Code

activity?.SetTag("http.response.status_code", "200"); // string instead of int

Good Code

activity?.SetTag("http.response.status_code", 200);

Properties

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

Configuration

dotnet_diagnostic.AL0086.severity = warning