Skip to content

Configure Gemini CLI to publish to the collector

Gemini CLI is configured in two places:

  1. ~/.gemini/settings.json to point its OTLP exporter at the collector (metrics, logs, traces).
  2. collector.yaml to enable on-disk session capture (full conversation content). No client-side change for this — gemini writes 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:

sources:
  transcript_json:
    enabled: true

That's it. The canonical root ~/.gemini/tmp is auto-discovered, so no per-host enumeration is required.

See also