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

# AL0068 - Metric name should follow naming conventions

> Use dot-separated namespaces and snake_case for metric names

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

## Description

Metric names should use dot-separated namespaces and snake\_case to follow OpenTelemetry naming conventions.

## Bad Code

```csharp theme={null}
var counter = meter.CreateCounter<long>("OrderCount");
var histogram = meter.CreateHistogram<double>("request-duration");
```

## Good Code

```csharp theme={null}
var counter = meter.CreateCounter<long>("myservice.order.count");
var histogram = meter.CreateHistogram<double>("http.server.request.duration");
```

## Properties

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

## Configuration

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