Send Gemini CLI telemetry
Send Gemini CLI OpenTelemetry data to SecureAuth Agent Authority to see token usage per user and per model
When you finish, you can see how many tokens each person uses in Gemini CLI, and on which models.
Gemini CLI sends this usage over OpenTelemetry (OTel) to SecureAuth Agent Authority's …/gemini ingest endpoint, and it appears in LLM Usage and on the Cost and adoption page, with cost derived from those token counts.
.gemini/settings.json
Important: Gemini CLI defaults to OTLP over gRPC (
otlpProtocol: "grpc",http://localhost:4317), which this gateway cannot accept. It only speaks OTLP over HTTP (protobuf or JSON). SetotlpProtocolto"http"explicitly, or Gemini CLI sends nothing and neither side reports an error.
Add the telemetry block to .gemini/settings.json, or ship it through your device-management tooling so it applies to every machine:
{
"telemetry": {
"enabled": true,
"otlpEndpoint": "<endpoint>/gemini",
"otlpProtocol": "http"
}
}Gemini CLI's settings have no field for request headers, but its OTLP exporter is built on the standard OpenTelemetry JS SDK, which reads the standard OTEL_EXPORTER_OTLP_HEADERS environment variable to authenticate.
Set it alongside those settings:
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <token>"Replace <endpoint> with the OTLP endpoint shown when you created the ingest key (for example, https://telemetry.your-gateway-host/api/v1/telemetry) and <token> with the saai_ingest_… key.
Environment variables
Equivalent environment-variable form, useful for fleet provisioning scripts:
export GEMINI_TELEMETRY_ENABLED=true
export GEMINI_TELEMETRY_OTLP_ENDPOINT="<endpoint>/gemini"
export GEMINI_TELEMETRY_OTLP_PROTOCOL=http
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <token>"Rolling it out org-wide
To enable telemetry for everyone automatically, mint one ingest key and ship this configuration to every developer machine through your provisioning or device-management tooling rather than asking each developer to edit their settings by hand. See the OpenTelemetry overview for the full rollout model.
Next steps
- Enforcement traffic – see per-user and per-model token trends once data starts flowing.
- Telemetry – the full OpenTelemetry rollout model, including how to push configuration to every machine.