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:

FieldRequiredDescription
customer_idyesCustomer to query.
metricyesMetric name from the catalog.
start_timenoStart of the query window (inclusive) as an RFC3339 timestamp. Empty defaults to 24h before end_time. Example: 2026-01-02T15:04:05Z.
end_timenoEnd 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.
stepnoBucket granularity. Unset (STEP_UNSPECIFIED) picks a step scaled to the query window; see Step.
group_bynoOptional breakdown dimension; omit for none.

Response fields:

FieldRequiredDescription
metricoutput-onlyMetric name that was queried.
entityoutput-onlyEntity the metric was queried for.
windowoutput-onlyTime window and bucket step the series cover.
seriesoutput-onlyOne time series per group (or a single series when ungrouped).
summaryoutput-onlyPer-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:

FieldRequiredDescription
metricyesMetric name from the catalog.
entityyesEntity id to query (interpreted per layer).
layeryesLayer: "USER""API_KEY""PROJECT""CUSTOMER""DATAPLANE""GATEWAY".
start_timenoStart of the query window (inclusive) as an RFC3339 timestamp. Empty defaults to 24h before end_time. Example: 2026-01-02T15:04:05Z.
end_timenoEnd 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.
stepnoBucket granularity. Unset (STEP_UNSPECIFIED) picks a step scaled to the query window; see Step.
group_bynoOptional breakdown dimension; omit for none.
endpointnoOptional 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:

FieldRequiredDescription
metricoutput-onlyMetric name that was queried.
entityoutput-onlyEntity the metric was queried for.
windowoutput-onlyTime window and bucket step the series cover.
seriesoutput-onlyOne time series per group (or a single series when ungrouped).
summaryoutput-onlyPer-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:

FieldRequiredDescription
metricsoutput-onlyMetrics DPO knows how to compute.
layersoutput-onlyLayers accepted by GetMetric's layer field.
endpoint_layersoutput-onlySubset of layers that support the endpoint (child-of-entity) dimension.
rawoutput-onlyThe 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:

FieldRequiredDescription
nameyesMetric name from the catalog's raw route.
servicenoOptional service filter.
endpointnoOptional endpoint (child-of-service) filter.
start_timenoStart of the query window (inclusive) as an RFC3339 timestamp. Empty defaults to 24h before end_time. Example: 2026-01-02T15:04:05Z.
end_timenoEnd 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.
stepnoBucket granularity. Unset (STEP_UNSPECIFIED) picks a step scaled to the query window; see Step.

Response fields:

FieldRequiredDescription
metricoutput-onlyMetric name that was queried.
entityoutput-onlyEntity the metric was queried for.
windowoutput-onlyTime window and bucket step the series cover.
seriesoutput-onlyOne time series per group (or a single series when ungrouped).
summaryoutput-onlyPer-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"}