Google Gemini logoGemini CLI ยท OpenTelemetry

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

Google Gemini logo

Gemini CLI

Coding agent

OpenTelemetry logo

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.

OpenTelemetry logo

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.

Gemini CLI OpenTelemetry metrics, official identifiers and what they measure
MetricWhat it measuresOfficial metric identifierPlain-English explanation
Session activityCLI startupsgemini_cli.session.countIncremented once per Gemini CLI startup, so it reflects how often the CLI is launched.
Tool callsTool invocationsgemini_cli.tool.call.countCounts tool calls, with attributes for the function name, success, the user decision and whether the tool is native or MCP.
Tool latencyTool call duration (ms)gemini_cli.tool.call.latencyMeasures how long tool calls take, broken down by function name.
API requestsModel API callsgemini_cli.api.request.countCounts all API requests, with model, status code and optional error type.
API latencyAPI request duration (ms)gemini_cli.api.request.latencyMeasures API request latency per model.
Token usageTokens consumedgemini_cli.token.usageCounts input, output, thought, cache and tool tokens, with the model as an attribute.
File operationsFile creates, reads and updatesgemini_cli.file.operation.countCounts file operations, with optional attributes such as line count, mimetype, extension and programming language.
Lines changedLines added or removedgemini_cli.lines.changedCounts 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.

Google Gemini logo

Gemini CLI

OpenTelemetry logo

OpenTelemetry

  • Metrics
  • Logs
  • Traces

OTLP

gRPC or HTTP

Collector or compatible backend

Read the official Gemini CLI telemetry documentation

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. Default false.
  • 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. Default true.
  • 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
Explore Gemini CLI with helloMetry

Explore Other OpenTelemetry Integrations

  • Claude logo

    Claude Code

    Claude Code OpenTelemetry: metrics, events and traces, configuration and privacy considerations.

    Read the guide
  • More 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