sum by (gen_ai_request_model) (
rate(gen_ai_client_token_usage_sum[1h]))Which model the token spend goes to.
A per-model rate, so a cost jump has a name attached before anyone opens a dashboard.
GenAI calls become spans and metrics through the OpenTelemetry SDK, using the standard semantic conventions. Model, operation, token counts and finish reason arrive on every call, so a cost jump has a cause you can point at.
Included on the free tier: 20,000 active series, 50 GB of logs and 50 GB of traces a month. No card.
What you get
No separate AI product and no extra meter. GenAI spans and metrics are billed as the traces and series they are.
How it gets there
GenAI spans leave through the OTLP exporter your SDK already has, into the same agent as the rest of your telemetry.
Install the OpenTelemetry contrib package for your provider.
Run the app under auto-instrumentation, pointed at your xScaler endpoint.
Model calls arrive with tokens and finish reason attached.
Coverage follows the OpenTelemetry contrib packages for each provider and language. For a client they don't cover, set the same GenAI attributes on a span you create yourself.
pip install opentelemetry-distro \
opentelemetry-exporter-otlp \
opentelemetry-instrumentation-openai-v2export OTEL_SERVICE_NAME=support-assistantexport OTEL_EXPORTER_OTLP_ENDPOINT="https://<your-xscaler-endpoint>"opentelemetry-instrument python app.pyWhat you can ask
Plain PromQL against the GenAI metrics. Paste any of these into Insights, or use them as an alert rule.
sum by (gen_ai_request_model) (
rate(gen_ai_client_token_usage_sum[1h]))A per-model rate, so a cost jump has a name attached before anyone opens a dashboard.
rate(gen_ai_client_token_usage_sum{gen_ai_token_type="output"}[1h])
/ rate(gen_ai_client_token_usage_sum{gen_ai_token_type="input"}[1h])Where prompt changes show. A system-prompt edit that doubles answer length moves this line first.
histogram_quantile(0.95, sum by (le, gen_ai_request_model)
(rate(gen_ai_client_operation_duration_bucket[5m])))Model latency on its own, separate from the retrieval and database work in the same request.
sum by (gen_ai_request_model) (
increase(gen_ai_client_token_usage_sum{gen_ai_token_type="input"}[30d]))
* 0.0000025We store tokens, not dollars. Enter your contract rate and the multiplier in the query updates.
Questions
Something not here? Talk to an engineer who works on the platform.
Book thirty minutesNo. GenAI spans leave through the OTLP exporter your SDK already has, into the same agent, and read back next to the rest of your telemetry. They are billed as the traces and series they are.
20,000 active series, 50 GB of logs and 50 GB of traces a month, 90-day retention, and the whole of Insights.