Skip to main content
Envoy AI Gateway follows the OpenTelemetry GenAI conventions, so one metric carries both directions of a call. See the upstream metrics reference.

What CostGraph scrapes

Connect the gateway in Settings > Integrations and CostGraph serves this target to the operator. Override the namespace or selector on the connection if you run it somewhere else.

How the metric maps

gen_ai_client_token_usage becomes costgraph_gen_ai_usage_total: The unit is always tokens. Envoy AI Gateway also reports gen_ai_token_type="total". CostGraph reads the input and output series and drops the total, so the same tokens are never counted twice.

Attribute usage to your customers

Map a request header onto the metrics. This is a controller-wide setting, so every gateway that controller manages shares the mapping.
--reuse-values keeps the settings the release already has. Without it, an upgrade that passes only this one --set discards every other value you configured.
The attribute customer.id arrives as the label customer_id: dots become underscores on the Prometheus side.

AI gateways

Connecting, pricing, and sending usage yourself.