Claude logoClaude Code ยท OpenTelemetry

Claude Code OpenTelemetry

A practical guide to Claude Code telemetry: available metrics, events and traces, configuration, privacy considerations, and what engineering teams can learn from the data.

Updated September 2026 ยท 12 min read

Claude logo

Claude Code

Coding agent

OpenTelemetry logo

OpenTelemetry

Export layer

Signals

  • Metrics
  • Events
  • Traces

Compatible backend

Your observability stack

Quick answer

What is Claude Code OpenTelemetry?

Claude Code supports OpenTelemetry (OTel) to export telemetry about how the coding agent is used across an engineering organization. It can export metrics as time-series data, events through the OpenTelemetry logs protocol, and optional distributed traces linking prompts to the API requests and tool executions they trigger.

This telemetry can be sent to OpenTelemetry-compatible observability backends to analyze Claude Code usage, token consumption, costs, sessions, tool activity, performance and development workflows.

OpenTelemetry logo

In short: OpenTelemetry makes Claude Code activity observable outside Claude Code itself.

Telemetry signals

What Telemetry Does Claude Code Provide?

Claude Code exposes three OpenTelemetry signal types. Metrics and events are available through the standard telemetry configuration, while distributed tracing is currently available as a beta feature and must be enabled separately.

  • Available

    Metrics

    Sessions, tokens, costs, lines of code, commits, pull requests, active time and permission decisions.

  • Available

    Events

    Prompts, API requests, tool activity, authentication, MCP connections, permission changes and other activity.

  • Beta

    Traces

    Links a prompt to the API requests and tool executions triggered by it.

Metrics reference

Claude Code OpenTelemetry Metrics

Claude Code currently exports eight primary OpenTelemetry metrics. Together, they provide quantitative signals about usage, AI consumption and development activity.

Claude Code OpenTelemetry metrics and what they measure
MetricWhat it measures
claude_code.session.countClaude Code sessions started
claude_code.lines_of_code.countLines of code added or removed
claude_code.pull_request.countPull requests or merge requests created
claude_code.commit.countGit commits created
claude_code.cost.usageEstimated cost of Claude Code usage
claude_code.token.usageNumber of tokens consumed
claude_code.code_edit_tool.decisionCode editing permission decisions
claude_code.active_time.totalActive Claude Code usage time

Use cases

What Can Engineering Teams Learn From Claude Code Telemetry?

Claude Code telemetry can help engineering organizations answer key questions about adoption, usage, costs and development workflows.

  • Adoption & Usage

    Understand whether Claude Code usage is growing, how frequently it is used and how adoption evolves over time.

  • AI Consumption & Costs

    Analyze token and cost metrics by user, team, model, skill, plugin or agent.

  • Development Activity

    Use lines of code, commits and pull requests as signals about how Claude Code participates in development workflows.

    Activity metrics should not be interpreted as standalone measures of developer productivity.

  • Tools & Agent Workflows

    Understand which tools are used, how frequently they are called, their execution times and where errors occur.

How it works

How Claude Code OpenTelemetry Works

Claude Code uses standard OpenTelemetry exporters, allowing organizations to send telemetry to their own observability infrastructure rather than a Claude-specific monitoring system.

Claude logo

Claude Code

OpenTelemetry logo

OpenTelemetry

  • Metrics
  • Events
  • Traces

OTLP

gRPC or HTTP

Collector or compatible backend

Read the official Claude Code OpenTelemetry documentation

Configuration

How to Enable OpenTelemetry in Claude Code

Telemetry can be enabled using environment variables or through managed settings.

export CLAUDE_CODE_ENABLE_TELEMETRY=1

export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp

export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

claude
View advanced configuration

Two optional environment variables control whether more detailed content is included in the exported telemetry:

  • OTEL_LOG_USER_PROMPTS=1 โ€” includes user prompt content, which is excluded by default.
  • OTEL_LOG_TOOL_DETAILS=1 โ€” includes tool arguments and parameters, which are excluded by default.

For exporter protocols, headers, export intervals and managed settings, refer to the official documentation.

Privacy

Privacy and Sensitive Data

OpenTelemetry can expose detailed information about developer activity, so telemetry configuration should be treated as a privacy and governance decision โ€” not only as an observability setting.

  • Source code

    Raw file contents and code snippets are not included in Claude Code metrics or events by default.

  • Prompts

    User prompt content is not collected by default. It is only included when OTEL_LOG_USER_PROMPTS=1 is explicitly enabled.

  • Tool details

    Tool arguments and parameters are excluded by default and require OTEL_LOG_TOOL_DETAILS=1 to be enabled.

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?

Claude Code provides detailed telemetry, but telemetry is not the same as insight.

Metrics and events can tell you how many tokens were consumed, how many sessions occurred or which tools were called. Engineering organizations still need to structure these signals to understand broader questions about AI adoption, costs and development workflows.

Turn Claude Code Telemetry Into Engineering Intelligence

helloMetry transforms supported telemetry from coding agents such as Claude Code into structured analytics designed to help engineering organizations understand how AI is being adopted and used.

  • Adoption
  • Usage
  • Costs
  • Workflows
Explore Claude Code with helloMetry

FAQ

Frequently Asked Questions

What is Claude Code OpenTelemetry?

Claude Code supports OpenTelemetry for exporting telemetry about its usage and operation, including metrics, events and optional traces.

Can I monitor Claude Code usage across a team?

Yes. Claude Code telemetry can be exported to compatible observability systems to analyze usage across an engineering organization.

Can I track Claude Code token usage?

Yes. Claude Code exposes telemetry related to token consumption, allowing teams to understand how AI consumption evolves over time.

Can I track Claude Code costs?

Claude Code provides cost-related telemetry that can be used to analyze estimated AI consumption and cost trends.

Does helloMetry replace OpenTelemetry?

No. OpenTelemetry provides the standard used to collect and export telemetry. helloMetry operates on top of supported telemetry to transform 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.