Table of Contents

AL0012: Deprecated semantic convention attribute

This attribute name has been deprecated in the OpenTelemetry semantic conventions.

When it triggers

// AL0012: 'http.method' is deprecated since schema v1.20.0. Use 'http.request.method' instead.
activity?.SetTag("http.method", "GET");

Why this matters

OpenTelemetry semantic conventions evolve over time. Using deprecated attribute names:

  • May cause interoperability issues with observability backends
  • Won't benefit from standardized tooling
  • Creates technical debt that becomes harder to fix later

How to fix

Update to the new attribute name:

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

Common renames

Deprecated New (since)
http.method http.request.method (v1.20.0)
http.url url.full (v1.20.0)
http.status_code http.response.status_code (v1.20.0)
net.peer.name server.address (v1.21.0)

Configuration

[*.cs]
dotnet_diagnostic.AL0012.severity = warning