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

# AL0063 - ActivitySource should be registered with AddSource()

> Unregistered ActivitySources will not emit spans

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

## Description

An `ActivitySource` that is not registered via `AddSource()` in the tracing configuration will silently drop all spans.

## Bad Code

```csharp theme={null}
private static readonly ActivitySource Source = new("MyService");
// But tracing setup never calls .AddSource("MyService")
```

## Good Code

```csharp theme={null}
private static readonly ActivitySource Source = new("MyService");

// In startup:
builder.Services.AddOpenTelemetry()
    .WithTracing(t => t.AddSource("MyService"));
```

## Properties

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

## Configuration

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