← Back to Optelly
Integration

Gemini CLI Monitoring & Observability

Gemini CLI has the most complete OTel implementation — logs, traces, and metrics with GenAI semantic convention compliance. Optelly captures token usage, thinking tokens, tool calls, lines changed, model routing, and multi-agent sessions.

What You Get

Token & Thinking Metrics
Track input, output, cached, and thinking tokens per request. See how much reasoning your Gemini agent does — unique visibility into extended thinking.
Rich Tool Tracking
See every tool call — file reads, edits, shell commands, grep searches, and even Google web searches — with duration, success status, and accept/reject decisions.
Session Timelines & Agent Lifecycle
Track full session history including agent start/finish events, model routing switches, conversation turn counts, and total session duration. Up to 90-day retention on Pro.
Lines of Code & Full OTel
Track lines added and removed per session. Gemini CLI exports logs, traces, and metrics natively — Optelly connects with one command, no proxy required.

Setup in 30 Seconds

1. Install
Run npx optelly setup — this configures the OTel environment variables that Gemini CLI reads automatically.
2. Code
Launch Gemini CLI as usual. Telemetry is exported automatically via OpenTelemetry — no changes to your workflow.
3. Watch
Open optelly.com to see your Gemini agent in the office. Track costs, tokens, and session activity live.
Get Started — Free
npx optelly setup
Also works with Claude Code and Codex