# Metric

> API reference for Metrics (metrics.clrk.apoxy.dev/v1alpha1)

**API Group:** `metrics.clrk.apoxy.dev/v1alpha1`

## Operations

### List Metric

<APIEndpoint method="GET" path="/apis/metrics.clrk.apoxy.dev/v1alpha1/metrics" />

list objects of kind Metric

**Response**

- `200`: OK

---

### List Metric

<APIEndpoint method="GET" path="/apis/metrics.clrk.apoxy.dev/v1alpha1/namespaces/{namespace}/metrics" />

list objects of kind Metric

**Response**

- `200`: OK

---

### Get Metric

<APIEndpoint method="GET" path="/apis/metrics.clrk.apoxy.dev/v1alpha1/namespaces/{namespace}/metrics/{name}" />

Get the specified Metric

**Response**

- `200`: OK

---

### Query Metric series

<APIEndpoint method="GET" path="/apis/metrics.clrk.apoxy.dev/v1alpha1/namespaces/{namespace}/metrics/{name}/series" />

Runs a metric query and returns a `MetricSeriesSet`. The query parameters (`metric`, `groupBy`, `since`, `until`, `step`, `quantiles`, `scopeKind`, `scopeName`) and the response shape are documented in [Query fleet metrics](/docs/clrk/guides/query-fleet-metrics.md).

---

## Schema Reference

### Metric

| Field | Type | Description |
| --- | --- | --- |
| `defaultGroupBy` | string | DefaultGroupBy is the dimension the console selects by default. |
| `description` | string | Description is a one-line human summary. |
| `groupBy` | string[] | GroupBy is the set of dimension keys this metric may be grouped by (the chart legends). One is passed as ?groupBy on the series subresource. |
| `legend` | string | Legend is a short human label for the default dimension. |
| `measures` | string[] | Measures are the named sub-values a single point carries when a metric reports more than one (e.g. gen_ai.tokens -&gt; input/output). Each becomes a "measure" label on its series. Empty for single-valued metrics. |
| `source` | string | Source is the backing table the recipe scans: "traces" or "logs". **(required)** |
| `type` | string | Type is Counter, Gauge, or Histogram. A histogram is queried with ?quantiles and returns one series per (group x quantile). **(required)** |
| `unit` | string | Unit is the value unit ("tokens", "requests", "bytes", "ms", ...). **(required)** |
