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

# Metrics

> Health and OpenTelemetry metrics exposed by supported Rime on-prem containers.

Rime's API and model services expose separate health endpoints. Check both before sending production traffic.

## API container health

The API container serves `/health` on port `8000`:

```bash theme={null}
curl --fail http://localhost:8000/health
```

A ready deployment returns HTTP 200 with `apiStatus: "ok"` and `modelReachable: true`:

```json theme={null}
{
  "apiStatus": "ok",
  "timestamp": "2026-08-15T12:00:00.000Z",
  "licenseStatus": "valid",
  "modelReachable": true
}
```

`licenseStatus` reads `expired-or-not-set` until the first authenticated request initializes the license, then `valid`. This does not affect the health endpoint's status code.

## Model container health

The model container serves `/livez` and `/readyz` on port `8080`. Use `/livez` to confirm that the process is running and `/readyz` to confirm that it can accept inference requests.

```bash theme={null}
curl --fail http://localhost:8080/livez
curl --fail http://localhost:8080/readyz
```

A ready model returns `ok`.

## OpenTelemetry metrics

The Rime engine exposes these metrics:

* `rime.engine.concurrent_pipeline`
* `rime.engine.generated_audio_duration`
* `rime.engine.gpu_load`
* `rime.engine.initial_latency`
* `rime.engine.invocation_request`
* `rime.engine.unicode_scalar_value_count`
* `rime.engine.stage.items_in`
* `rime.engine.stage.items_out`
* `rime.engine.stage.first_output_latency`

The `rime.engine.stage.*` series carry a `stage` attribute.

Set `OTEL_COLLECTOR_PROTOCOL` to `grpc` (recommended), `http/protobuf`, or `http/json`, and set `OTEL_COLLECTOR_ENDPOINT` to your collector endpoint:

```bash theme={null}
OTEL_COLLECTOR_PROTOCOL=grpc
OTEL_COLLECTOR_ENDPOINT=http://otelcol:4317
```

The model does not set resource attributes. Use `OTEL_RESOURCE_ATTRIBUTES` to add them. The model also does not implement OpenTelemetry authentication, so run a collector sidecar when the upstream endpoint requires credentials.

To expose the OpenTelemetry series for Prometheus, follow the [Prometheus integration guide](/docs/on-prem/prometheus).

## Histogram tuning

Metrics that emit histogram data use preconfigured bucket boundaries. Override them with the corresponding `HISTOGRAM_BUCKETS_*` environment variable. Add a separate suffix with `HISTOGRAM_SUFFIX_*` when you need to distinguish differently tuned series.

### Initial latency

`rime.engine.initial_latency` is measured in milliseconds.

Default bounds:

```text theme={null}
0.0, 100.0, 150.0, 200.0, 225.0, 250.0, 275.0, 300.0, 325.0, 350.0, 375.0, 400.0, 450.0, 500.0, 1000.0
```

Example overrides:

```bash theme={null}
HISTOGRAM_BUCKETS_INITIAL_LATENCY_MS='0.0, 90.0, 95.0, 100.0, 105.0, 110.0, 115.0, 120.0, 125.0, 130.0, 135.0, 140.0, 150.0, 175.0, 200.0'
HISTOGRAM_SUFFIX_INITIAL_LATENCY='tuned_120ms'
```

The suffix produces `rime.engine.initial_latency.tuned_120ms`.

### Generated audio duration

`rime.engine.generated_audio_duration` is measured in seconds.

Default bounds:

```text theme={null}
0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.5, 10.0, 20.0, 30.0, 60.0
```

Example overrides:

```bash theme={null}
HISTOGRAM_BUCKETS_GENERATED_AUDIO_DURATION_SECONDS='0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.5, 10.0, 20.0, 30.0, 60.0'
HISTOGRAM_SUFFIX_GENERATED_AUDIO_DURATION='tuned_3s'
```

The suffix produces `rime.engine.generated_audio_duration.tuned_3s`.
