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

# AL0071 - [Meter] class must be partial static

> Source generator requires the class to be partial static

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

## Description

Classes annotated with `[Meter]` must be `partial static` so the source generator can emit the metric instrument implementations.

## Bad Code

```csharp theme={null}
[Meter("MyService")]
public class MyMetrics
{
    [Counter] public static partial void OrderCount();
}
```

## Good Code

```csharp theme={null}
[Meter("MyService")]
public static partial class MyMetrics
{
    [Counter] public static partial void OrderCount();
}
```

## Properties

* **Category**: Metrics
* **Severity**: Error
* **Enabled by default**: True
* **Code fix available**: True

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0071.severity = error
```
