Guardrails and usage
token_usage_metrics
Read the release-matched token usage metrics documentation and its scope.
On this page
Emits bounded per-tenant Prometheus token counters from token.* metadata.
Configuration Notes
The filter fails configuration unless tenant and model allowlists are explicit. Requests without authenticated tenant metadata are skipped. Values outside either allowlist map to fixed overflow labels.
The admin /metrics endpoint remains an operator boundary: protect it with network policy and authentication. Prometheus labels do not provide tenant authorization or billing-grade accounting.
Declare this filter before token_count so response hooks (which run in reverse order) extract counts first.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
tenant_metadata_key | string | no | Exact unnamespaced metadata key populated from verified credentials by an authentication filter. Namespaced keys are rejected because identity_header_guard stores unverified client headers there. |
allowed_tenants | string[] | yes | Tenant labels admitted as their own Prometheus series. |
allowed_models | string[] | yes | Model labels admitted as their own Prometheus series. |
overflow_tenant | string | no | Label for an authenticated tenant not in allowed_tenants. |
overflow_model | string | no | Label for a model not in allowed_models. |