Configure Gemini CLI to publish to the collector¶
Gemini CLI is configured in two places:
~/.gemini/settings.jsonto point its OTLP exporter at the collector (metrics, logs, traces).collector.yamlto enable on-disk session capture (full conversation content). No client-side change for this —geminiwrites the file regardless.
For the upstream OTLP reference: Gemini CLI Telemetry.
Prerequisites
Finish Deploy the collector on the host first.
What to set in ~/.gemini/settings.json¶
Add a telemetry block to ~/.gemini/settings.json:
{
"telemetry": {
"enabled": true,
"target": "local",
"useCollector": true,
"otlpEndpoint": "http://127.0.0.1:4318",
"otlpProtocol": "http",
"logPrompts": false
}
}
Restart gemini to pick up the change. Gemini auto-appends /v1/logs, /v1/metrics, and /v1/traces to the configured otlpEndpoint — set the host once and all three signal types route correctly.
What to set on the collector¶
Add the following to collector.yaml and restart the collector:
That's it. The canonical root ~/.gemini/tmp is auto-discovered, so no per-host enumeration is required.