Metrics
Package: agentrouter.metrics.v1 Service: MetricsService
Endpoints
Get a customer metric (admin)
What it does: Returns a customer-level (CUSTOMER-layer) metric for any customer.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | yes | Customer to query. |
metric | yes | Metric name from the catalog. |
start_time | no | Start of the query window (inclusive) as an RFC3339 timestamp. Empty defaults to 24h before end_time. Example: 2026-01-02T15:04:05Z. |
end_time | no | End of the query window (exclusive) as an RFC3339 timestamp. Empty defaults to now, or to 24h after start_time when only start_time is set. |
step | no | Bucket granularity. Unset (STEP_UNSPECIFIED) picks a step scaled to the query window; see Step. |
group_by | no | Optional breakdown dimension; omit for none. |
Response fields:
| Field | Required | Description |
|---|---|---|
metric | output-only | Metric name that was queried. |
entity | output-only | Entity the metric was queried for. |
window | output-only | Time window and bucket step the series cover. |
series | output-only | One time series per group (or a single series when ungrouped). |
summary | output-only | Per-window rollup across the series. |
{"signatures":{"go":"c.Metrics().GetCustomerMetric(ctx, \u0026metricsv1.GetCustomerMetricRequest{...})","python":"client.metrics.getcustomermetric(...)","typescript":"client.metrics.getcustomermetric({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../metrics/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for MetricsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for MetricsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for MetricsService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../metrics/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"App Developer (API key)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/metrics/{metric}","slug":"get-a-customer-metric-admin"}
Get a metric by entity and layer (admin)
Changed in v0.5.0 (behaviour changes): Reaching a fleet-wide operation now requires an explicit platform binding for a caller that does not hold the admin scope. A management API key that reached one of these operations on a coarse scope alone, such as read or metrics_reader, is refused after this upgrade.
Changed in v0.5.0 (bug fixes): Scoped management API keys can now reach audit-log and metrics operations without organization or project fields. The handler applies the relevant workspace, organization or platform boundary for each operation.
What it does: Returns a metric for any entity in any layer, including the infra layers DATAPLANE and GATEWAY. entity and layer are taken from the request.
Request fields:
| Field | Required | Description | |||||
|---|---|---|---|---|---|---|---|
metric | yes | Metric name from the catalog. | |||||
entity | yes | Entity id to query (interpreted per layer). | |||||
layer | yes | Layer: "USER" | "API_KEY" | "PROJECT" | "CUSTOMER" | "DATAPLANE" | "GATEWAY". |
start_time | no | Start of the query window (inclusive) as an RFC3339 timestamp. Empty defaults to 24h before end_time. Example: 2026-01-02T15:04:05Z. | |||||
end_time | no | End of the query window (exclusive) as an RFC3339 timestamp. Empty defaults to now, or to 24h after start_time when only start_time is set. | |||||
step | no | Bucket granularity. Unset (STEP_UNSPECIFIED) picks a step scaled to the query window; see Step. | |||||
group_by | no | Optional breakdown dimension; omit for none. | |||||
endpoint | no | Optional child of entity for a layer that supports DPO's endpoint model (e.g. a CUSTOMER-layer entity's project, or a USER-layer entity's api key). Omit for layers with no endpoint dimension. |
Response fields:
| Field | Required | Description |
|---|---|---|
metric | output-only | Metric name that was queried. |
entity | output-only | Entity the metric was queried for. |
window | output-only | Time window and bucket step the series cover. |
series | output-only | One time series per group (or a single series when ungrouped). |
summary | output-only | Per-window rollup across the series. |
{"signatures":{"go":"c.Metrics().GetMetric(ctx, \u0026metricsv1.GetMetricRequest{...})","python":"client.metrics.getmetric(...)","typescript":"client.metrics.getmetric({...})","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/metrics/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for MetricsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for MetricsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for MetricsService yet -- use the CLI or curl example below.","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/metrics/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"App Developer (API key)","httpVerb":"GET","httpPath":"/v1/metrics/{metric}","slug":"get-a-metric-by-entity-and-layer-admin"}
List available metrics (admin)
Changed in v0.5.0 (behaviour changes): Reaching a fleet-wide operation now requires an explicit platform binding for a caller that does not hold the admin scope. A management API key that reached one of these operations on a coarse scope alone, such as read or metrics_reader, is refused after this upgrade.
Changed in v0.5.0 (bug fixes): Scoped management API keys can now reach audit-log and metrics operations without organization or project fields. The handler applies the relevant workspace, organization or platform boundary for each operation.
What it does: Returns DPO's metric catalog: the known metrics, the layers and endpoint-layers supported, and the raw-metric passthrough route (DPO#22). This coexists with GetMetric's /v1/metrics/{metric}: an exact path match on /v1/metrics routes here.
Request body: None.
Response fields:
| Field | Required | Description |
|---|---|---|
metrics | output-only | Metrics DPO knows how to compute. |
layers | output-only | Layers accepted by GetMetric's layer field. |
endpoint_layers | output-only | Subset of layers that support the endpoint (child-of-entity) dimension. |
raw | output-only | The raw-metric passthrough route (DPO#21). |
{"signatures":{"go":"c.Metrics().ListMetrics(ctx, \u0026metricsv1.ListMetricsRequest{...})","python":"client.metrics.listmetrics(...)","typescript":"client.metrics.listmetrics({...})","cli":"tare api metrics catalog list","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/metrics\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for MetricsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for MetricsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for MetricsService yet -- use the CLI or curl example below.","cli":"tare api metrics catalog list","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/metrics\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"App Developer (API key)","httpVerb":"GET","httpPath":"/v1/metrics","slug":"list-available-metrics-admin"}
Get a raw metric (admin)
Changed in v0.5.0 (behaviour changes): Reaching a fleet-wide operation now requires an explicit platform binding for a caller that does not hold the admin scope. A management API key that reached one of these operations on a coarse scope alone, such as read or metrics_reader, is refused after this upgrade.
Changed in v0.5.0 (bug fixes): Scoped management API keys can now reach audit-log and metrics operations without organization or project fields. The handler applies the relevant workspace, organization or platform boundary for each operation.
What it does: Returns an unaggregated (raw) metric, bypassing the summary rollup (DPO#21).
Request fields:
| Field | Required | Description |
|---|---|---|
name | yes | Metric name from the catalog's raw route. |
service | no | Optional service filter. |
endpoint | no | Optional endpoint (child-of-service) filter. |
start_time | no | Start of the query window (inclusive) as an RFC3339 timestamp. Empty defaults to 24h before end_time. Example: 2026-01-02T15:04:05Z. |
end_time | no | End of the query window (exclusive) as an RFC3339 timestamp. Empty defaults to now, or to 24h after start_time when only start_time is set. |
step | no | Bucket granularity. Unset (STEP_UNSPECIFIED) picks a step scaled to the query window; see Step. |
Response fields:
| Field | Required | Description |
|---|---|---|
metric | output-only | Metric name that was queried. |
entity | output-only | Entity the metric was queried for. |
window | output-only | Time window and bucket step the series cover. |
series | output-only | One time series per group (or a single series when ungrouped). |
summary | output-only | Per-window rollup across the series. |
{"signatures":{"go":"c.Metrics().GetRawMetric(ctx, \u0026metricsv1.GetRawMetricRequest{...})","python":"client.metrics.getrawmetric(...)","typescript":"client.metrics.getrawmetric({...})","cli":"tare api metrics raw get --name $NAME","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/raw-metrics/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for MetricsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for MetricsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for MetricsService yet -- use the CLI or curl example below.","cli":"tare api metrics raw get --name $NAME","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/raw-metrics/01H...\" \\\n -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"App Developer (API key)","httpVerb":"GET","httpPath":"/v1/raw-metrics/{name}","slug":"get-a-raw-metric-admin"}