> ## 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.

# AL0108 - Redundant [NoTrace] attribute

> [NoTrace] has no effect when the declaring type has no [Traced] attribute

Source: [Al0108RedundantNoTraceAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/Al0108RedundantNoTraceAnalyzer.cs)

## Description

`[NoTrace]` excludes a method from automatic span creation when the class has `[Traced]`. Without `[Traced]` on the class or any base class, `[NoTrace]` is redundant.

## Bad Code

```csharp theme={null}
// No [Traced] on class — [NoTrace] is redundant
public class OrderService
{
    [NoTrace]
    public void HelperMethod() { }
}
```

## Good Code

```csharp theme={null}
[Traced("MyApp")]
public class OrderService
{
    [NoTrace]  // Meaningful: excludes this method from tracing
    public void HelperMethod() { }
}
```

## Properties

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

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0108.severity = suggestion
```
