> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AL0086 - Incorrect attribute type

> Use correct types for OpenTelemetry attributes

Source: [Al0086IncorrectAttributeTypeAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/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

```csharp theme={null}
activity?.SetTag("http.response.status_code", "200"); // string instead of int
```

## Good Code

```csharp theme={null}
activity?.SetTag("http.response.status_code", 200);
```

## Properties

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

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0086.severity = warning
```
