Gemini CLI OpenTelemetry
A practical guide to Gemini CLI telemetry: available metrics, logs and traces, configuration, privacy considerations, and what engineering teams can learn from the data.
Updated September 2026 ยท 12 min read
Gemini CLI
Coding agent
OpenTelemetry
Export layer
Signals
- Metrics
- Logs
- Traces
Compatible backend
Your observability stack
Quick answer
What is Gemini CLI OpenTelemetry?
Gemini CLI includes built-in OpenTelemetry support for collecting and exporting telemetry about CLI usage and performance. It can generate logs, metrics and traces that help teams understand sessions, model usage, token consumption, tool activity, API requests, errors and development activity.
Telemetry can be exported locally or sent to an OpenTelemetry-compatible backend, giving organizations control over how Gemini CLI activity is observed and analyzed.
In short: OpenTelemetry makes Gemini CLI activity observable beyond the local developer environment.
Telemetry signals
What Telemetry Does Gemini CLI Provide?
Gemini CLI uses OpenTelemetry to expose three complementary types of telemetry signals.
- Available
Metrics
Quantitative measurements about sessions, token usage, tool calls, API activity, file operations and development activity.
- Available
Logs
Structured events describing prompts, model requests, tool calls, API responses and other Gemini CLI activity.
- Available
Traces
Distributed traces that help follow operations and understand how Gemini CLI executes requests and workflows.
Metrics reference
Gemini CLI OpenTelemetry Metrics
Gemini CLI exposes OpenTelemetry metrics covering usage, model consumption, tool activity and development workflows. Identifiers below come from the official Gemini CLI telemetry documentation.
| Metric | What it measures | Official metric identifier | Plain-English explanation |
|---|---|---|---|
| Session activity | CLI startups | gemini_cli.session.count | Incremented once per Gemini CLI startup, so it reflects how often the CLI is launched. |
| Tool calls | Tool invocations | gemini_cli.tool.call.count | Counts tool calls, with attributes for the function name, success, the user decision and whether the tool is native or MCP. |
| Tool latency | Tool call duration (ms) | gemini_cli.tool.call.latency | Measures how long tool calls take, broken down by function name. |
| API requests | Model API calls | gemini_cli.api.request.count | Counts all API requests, with model, status code and optional error type. |
| API latency | API request duration (ms) | gemini_cli.api.request.latency | Measures API request latency per model. |
| Token usage | Tokens consumed | gemini_cli.token.usage | Counts input, output, thought, cache and tool tokens, with the model as an attribute. |
| File operations | File creates, reads and updates | gemini_cli.file.operation.count | Counts file operations, with optional attributes such as line count, mimetype, extension and programming language. |
| Lines changed | Lines added or removed | gemini_cli.lines.changed | Counts added or removed lines, with the change type as an attribute. |
Use cases
What Can Engineering Teams Learn From Gemini CLI Telemetry?
Gemini CLI telemetry can help engineering organizations answer questions about adoption, AI consumption, development workflows and agent performance.
Adoption & Usage
Understand how Gemini CLI usage evolves across engineering teams by analyzing sessions, activity and usage patterns over time.
AI Consumption
Analyze model and token consumption to understand how AI resources are being used across development workflows.
Development Activity
File operations and code-change telemetry can provide signals about how Gemini CLI participates in software development.
Development activity metrics should be treated as contextual signals, not standalone measures of developer productivity.
Tools & Performance
Analyze tool calls, API activity, execution behavior and errors to understand how Gemini CLI operates inside agentic workflows.
How it works
How Gemini CLI OpenTelemetry Works
Gemini CLI generates OpenTelemetry telemetry that can be exported locally or sent to compatible observability infrastructure.
Gemini CLI
OpenTelemetry
- Metrics
- Logs
- Traces
OTLP
gRPC or HTTP
Collector or compatible backend
Configuration
How to Enable OpenTelemetry in Gemini CLI
Gemini CLI telemetry is controlled through the telemetry block of .gemini/settings.json, and each setting can be overridden by an environment variable. Telemetry is disabled by default.
// .gemini/settings.json
{
"telemetry": {
"enabled": true,
"target": "local",
"otlpEndpoint": "http://localhost:4317",
"otlpProtocol": "grpc"
}
}View advanced configuration
Documented settings, each with a matching environment variable override:
traces(GEMINI_TELEMETRY_TRACES_ENABLED) โ enables detailed attribute tracing. Defaultfalse.target(GEMINI_TELEMETRY_TARGET) โ"local"or"gcp".outfile(GEMINI_TELEMETRY_OUTFILE) โ writes telemetry to a file and overrides the OTLP endpoint.logPrompts(GEMINI_TELEMETRY_LOG_PROMPTS) โ includes prompts in telemetry logs. Defaulttrue.useCollector(GEMINI_TELEMETRY_USE_COLLECTOR) โ uses an external OTLP collector instead of direct export.useCliAuth(GEMINI_TELEMETRY_USE_CLI_AUTH) โ uses CLI credentials for telemetry, for the Google Cloud target only.
For Google Cloud export prerequisites, IAM roles and collector-based setups, refer to the official documentation.
Privacy
Privacy and Sensitive Data
AI coding telemetry can contain detailed information about developer interactions and workflows. Organizations should decide explicitly which telemetry they need before enabling collection at scale.
Prompts & Content
Prompt content is controlled by the logPrompts setting (environment variable GEMINI_TELEMETRY_LOG_PROMPTS), which is enabled by default. Set it to false to stop including prompts in telemetry logs.
Development Data
File operation and lines-changed telemetry carry attributes such as file extension, mimetype and programming language. Evaluate this data against your organization's privacy and security requirements before collecting it at scale.
Telemetry Destination
The target setting sends telemetry either locally or to Google Cloud, and otlpEndpoint plus otlpProtocol define the OTLP destination. Organizations therefore control where supported telemetry is exported and processed.
Good practice: Collect the minimum telemetry required for the questions your organization wants to answer. More telemetry does not automatically mean better observability.
From telemetry to analytics
OpenTelemetry Gives You the Data. What Do You Do With It?
Gemini CLI provides detailed telemetry about AI-assisted development, but raw telemetry does not automatically explain how AI adoption is evolving across an engineering organization.
Metrics, logs and traces still need to be structured and interpreted to answer broader questions about adoption, AI consumption, development workflows and costs.
Turn Gemini CLI Telemetry Into Engineering Intelligence
helloMetry transforms supported AI coding telemetry into structured analytics designed to help engineering organizations understand how AI is being adopted and used.
- Adoption
- Usage
- AI Consumption
- Workflows
Overview
- Code38%
- Analysis24%
- Writing18%
- Research12%
- Other8%
- /code_review142 usages4.892
- /debug98 usages3.210
- /refactor85 usages2.761
- /data_analysis74 usages2.104
- /summarize68 usages1.874
Explore Other OpenTelemetry Integrations

Claude Code
Claude Code OpenTelemetry: metrics, events and traces, configuration and privacy considerations.
Read the guideMore integrations
Coming soon โ additional OpenTelemetry guides for other AI coding agents.
FAQ
Frequently Asked Questions
Does Gemini CLI support OpenTelemetry?
Yes. Gemini CLI includes built-in OpenTelemetry support and can generate telemetry using metrics, logs and traces.
What can Gemini CLI telemetry measure?
Gemini CLI telemetry can provide information about sessions, model and token usage, tools, API activity, file operations, development activity and performance.
Can Gemini CLI telemetry be exported to another backend?
Yes. Gemini CLI supports OpenTelemetry-based export, allowing telemetry to be sent to compatible observability infrastructure.
Can Gemini CLI token usage be monitored?
Yes. Gemini CLI exposes telemetry related to model and token consumption that can be analyzed over time.
Does helloMetry replace OpenTelemetry?
No. OpenTelemetry provides the standard used to collect and export telemetry. helloMetry uses supported telemetry to turn AI coding agent data into engineering analytics.
Is helloMetry an employee monitoring tool?
helloMetry is designed to help organizations understand AI adoption, usage, costs and engineering workflows rather than rank developers using simplistic activity metrics.
Sources & further reading
Primary technical source: official Google / Gemini CLI documentation
Google โ Gemini CLI Telemetry