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 Code
Coding agent
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.
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.
| Metric | What it measures |
|---|---|
claude_code.session.count | Claude Code sessions started |
claude_code.lines_of_code.count | Lines of code added or removed |
claude_code.pull_request.count | Pull requests or merge requests created |
claude_code.commit.count | Git commits created |
claude_code.cost.usage | Estimated cost of Claude Code usage |
claude_code.token.usage | Number of tokens consumed |
claude_code.code_edit_tool.decision | Code editing permission decisions |
claude_code.active_time.total | Active 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 Code
OpenTelemetry
- Metrics
- Events
- Traces
OTLP
gRPC or HTTP
Collector or compatible backend
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
claudeView 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
Overview
- Code38%
- Analysis24%
- Writing18%
- Research12%
- Other8%
- /code_review142 usages4.892
- /debug98 usages3.210
- /refactor85 usages2.761
- /data_analysis74 usages2.104
- /summarize68 usages1.874
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.
Sources & further reading
Primary source
Anthropic โ Monitoring Claude Code usage with OpenTelemetry