# Metrics

> Where the control plane's metrics come from, how they are named, and how to look up which metrics exist and which labels each carries, with the commands that answer them.

The control plane keeps 30 days of metrics in its metrics store: what the API gateway counts for every request, what each inference node measures on its machine and its GPUs, what each model's containers use, and what the control plane measures itself, such as its test requests to every model. The Usage page, the alerts and the DevOps agent's charts read them, and so can your own Grafana.

This page lists no metric. The metrics store answers which metrics exist now, with the commands below, so the answer always matches the running system.

## How metrics are named

Every metric of the platform starts with `onprem_ai_`, then names the part that measures it (`onprem_ai_api_gateway_...`, `onprem_ai_gpu_...`), then what it measures. To find the metrics of one part or one subject, list the names that contain it (below).

A name ending in `_total` is a counter: it only grows, so query its rate (`rate(...[5m])`). A name ending in `_seconds` with `_bucket`, `_sum` and `_count` series is a histogram: query a quantile with `histogram_quantile`. Every other metric is a gauge: its value is the measurement itself.

Labels say whose measurement it is, with the control plane's own ids: `inference_node_id`, `inference_service_id`, `inference_service_replica_id`, `routing_model_id` (the model name clients send), `gpu_uuid`, `api_gateway_key_name`.

## Which metrics exist

List the metric names, optionally those containing a text:

```bash
curl -H "Authorization: Bearer $CONTROL_PLANE_API_KEY" \
  "https://10.0.4.10:3443/api/v1/time-series/list-names?name_filter=gpu"
```

```bash
onprem-ai-ctl api GET "/api/v1/time-series/list-names?name_filter=gpu"
```

The answer lists at most 500 names, sorted, and `total_matching` says how many matched. Over MCP, the same command is `time_series_read`, operation `list_names`.

## Which labels a metric carries

Query the metric once; every series in the answer carries its labels:

```bash
curl -G -H "Authorization: Bearer $CONTROL_PLANE_API_KEY" \
  "https://10.0.4.10:3443/api/v1/time-series/query" \
  --data-urlencode 'query=onprem_ai_gpu_temperature_celsius'
```

Each entry of `series` has `labels` and its latest point. To see the label values without the samples, group by the label: `count by (inference_node_id) (onprem_ai_gpu_temperature_celsius)`. Over MCP, the command is `time_series_read`, operation `query`; `query_range` answers a window (`start`, `end`, `step`).

The commands need the permission `metrics:read`. A query the metrics store refuses answers with the store's reason.

## Read the metrics in Grafana

The metrics store's reads are also served in the Prometheus HTTP API, at `https://<control-plane-address>/api/v1/prometheus`, so your own Grafana reads them as a Prometheus data source with a key that holds only the scope `prometheus:read`. See [Grafana](/en/platform/docs/guides/integrations/grafana/index.md).

For dashboards and every other reader outside the platform, the metric names and labels are experimental: an update can rename, remove or relabel a metric, without notice ahead. Look the names up with the commands above, and correct a dashboard's queries after an update.
