Claude Code observability: what OpenTelemetry shows, and what it can't
Claude Code has OpenTelemetry built in: six environment variables and you get 8 metrics, 28 kinds of events and, in beta, traces. It tells you who ran it, for how long, at what cost, and what broke. It never tells you which ticket the work was for. That is the part that decides whether the spend was worth it.
How to monitor Claude Code with OpenTelemetry
- Turn it on
- Set
CLAUDE_CODE_ENABLE_TELEMETRY=1, choose exporters for metrics and logs (events), pointOTEL_EXPORTER_OTLP_ENDPOINTat your collector and startclaude. The block below is Anthropic's quick start (docs), plus the beta traces switch. - Check it
- Look for the
claude_code.session.countmetric in your backend; Claude Code sends it when a session starts. For a logs-only setup, send a prompt and look forclaude_code.user_prompt. - Roll it out
- “Administrators can configure OpenTelemetry settings for all users through the managed settings file.” Exporter variables in a repository's
.claude/settings.jsonare ignored, so a repo cannot redirect your telemetry. - Read it
- Any OTLP backend. SigNoz has a Claude Code guide and dashboard, Sentry a cookbook, and freeCodeCamp a walk-through with Jaeger, Prometheus, Loki and Grafana. Defaults: metrics every 60 seconds, events every 5.
# 1. Turn telemetry on export CLAUDE_CODE_ENABLE_TELEMETRY=1 # 2. Pick exporters export OTEL_METRICS_EXPORTER=otlp # otlp, prometheus, console, none export OTEL_LOGS_EXPORTER=otlp # otlp, console, none # 3. Point it at your collector export OTEL_EXPORTER_OTLP_PROTOCOL=grpc export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer your-token" # 4. Optional: traces (beta) export CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 export OTEL_TRACES_EXPORTER=otlp $ claude
What Claude Code sends: 8 metrics, 28 events, traces
Every metric carries the same standard attributes: session.id, user.account_uuid, user.email, organization.id, terminal.type and the app version. Set OTEL_METRICS_INCLUDE_REPOSITORY=true to add the repository. These are all of the metrics, with Anthropic's own descriptions.
| Metric | What it counts | Unit |
|---|---|---|
| claude_code.session.count | Count of sessions started | none |
| claude_code.lines_of_code.count | Count of lines of code modified | none |
| claude_code.pull_request.count | Number of pull requests created | none |
| claude_code.commit.count | Number of git commits created | none |
| claude_code.cost.usage | Cost of the Claude Code session | USD |
| claude_code.token.usage | Number of tokens used | tokens |
| claude_code.code_edit_tool.decision | Count of code editing tool permission decisions | none |
| claude_code.active_time.total | Total active time | s |
Events go out through the logs exporter, one per thing that happened. The bold ones are the ones most dashboards are built on; each is claude_code. plus the name.
Traces are beta: “Tracing is off by default. To enable it, set both CLAUDE_CODE_ENABLE_TELEMETRY=1 and CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1, then set OTEL_TRACES_EXPORTER.” Each prompt becomes a claude_code.interaction span with its model requests, tools and hooks underneath, including the time a tool sat waiting for you.
Privacy defaults. The prompt field is “Redacted by default. Set OTEL_LOG_USER_PROMPTS=1 to include it.” Tool details, tool content, assistant responses and raw API bodies each need their own switch. Two numbers to read with care: cost is “Estimated cost in USD”, not your invoice, and active time counts the person's typing and reading as well as the tool's own work.
The question telemetry can't answer
Say your Claude Code dashboard shows that Sam spent $41 yesterday across 9 sessions in halden/billing. You cannot see that $6 of it fixed a double-charge bug that was refunding customers, and $30 went on a refactor nobody asked for. The signals describe the tool. The work lives somewhere else.
The obvious fix is to tag sessions with a ticket. Claude Code lets you add your own attributes, and the docs show the pattern for teams: OTEL_RESOURCE_ATTRIBUTES="department=engineering,team.id=platform,cost_center=eng-123". It works for a team or a cost center. It breaks for tickets.
OTEL_RESOURCE_ATTRIBUTES="ticket=HAL-69" claude
Set once, when the process starts. When the same session moves on to HAL-70, everything after it is still filed under HAL-69. Someone has to remember to set it every time, and Anthropic warns: “Each custom key becomes a label on every metric series, so high-cardinality values increase storage cost in your metrics backend.” Ticket IDs are as high-cardinality as labels get.
> work on HAL-69 > ... > HAL-70: now the CSV export
The Jenzo plugin attributes each model call to the ticket the session is working on: the one it started its AI clock on, or the ref the prompt leads with. When the prompt switches to HAL-70, so does the usage. Nothing to set at launch, and the ticket lives in Jenzo, not in your metrics bill.
Three layers, three different questions
Our take: observability for Claude Code is three jobs, and teams get stuck when they expect one tool to do all three. Keep the stack you have for the first two. The third is the one that turns AI spend into something a manager or a client can read.
Your OpenTelemetry backend
Is Claude Code working, and where does it fail?
Errors, retries, refusals, latency, permission decisions, traces. SigNoz, Sentry, Grafana, whatever you run.
Anthropic's analytics
Who uses it, and how much?
Sessions, lines accepted, pull requests, spend by person. The Teams and Enterprise dashboard or the API.
Jenzo
What was it for, and was it worth it?
Each session on its ticket: kind of work, who launched it, decisions, questions, AI time and cost per ticket.
The work layer, as it looks in Jenzo
Jenzo's demo workspace, Halden & Co. These are the app's own screens, not mockups.
Every session on the ticket it was for
The double-charge fix took two Claude Code sessions, both launched by Sam: $6.15 at API prices, 1h 01m of AI working time, and 9 minutes paused while it waited on a person. Tokens per model, from the transcript.
That pause is the beta trace's blocked_on_user span, turned into something a manager can read.


Claude Code next to Codex, Cursor and Gemini CLI
OpenTelemetry from Claude Code covers Claude Code. Most teams run more than one tool. Jenzo puts them on the same tickets, and shows what is not on a ticket yet, so nothing hides.
Switch the slice to kind of work, person or model and each one opens on its tickets.


Claude Code monitoring options, compared
Pick by the question you need answered. If it is "why did sessions fail last night", OpenTelemetry. If it is "what did that feature cost", the record has to be on the ticket.
| Option | For | Per person | Per repo | Per ticket | Tools covered |
|---|---|---|---|---|---|
| OpenTelemetry to your backend | Any team that runs a collector | Yes (user.email, user.id) | Opt-in | Only with a launch-time attribute | Claude Code only |
| Claude Code analytics dashboard | Teams and Enterprise | Yes | Contributions, GitHub repos | No | Claude Code only |
| /usage and local tools | One person | Only yourself | No | No | One tool at a time |
| Jenzo | Any team | Yes, who launched each session | Yes (project folder) | Yes, per model call | Claude Code, Codex, Cursor, Gemini CLI |
Checked on the vendors' own pages, 28 November 2026: Claude Code monitoring, Claude Code analytics, SigNoz, Sentry. Anthropic's analytics page itself says: “For per-user token counts and cost estimates, configure OpenTelemetry export”.
Add the work layer in two minutes
Keep your OTel export
Nothing to undo. Jenzo reads the local transcript after each session and sends counts only, alongside whatever you already export.
Install the Jenzo plugin
One command in Claude Code. It adds the MCP server and the usage hook.
Work on tickets
Say "work on HAL-69" or let Claude Code ask what is next. Each model call lands on that ticket.
claude plugin marketplace add https://app.jenzo.ai/claude/marketplace.json claude plugin install jenzo@jenzo --config token=YOUR_TOKEN
work on HAL-69
The limits, plainly. Jenzo is not an observability backend: no error rates, latency or traces, keep your stack for those. It sends counts only (model, tokens, time, the project folder's name), never code, prompts or file paths. Cost is at API list prices, so on a subscription it is usage, not your bill. Cursor keeps no token counts on disk, so its cost is estimated and labelled that way.
The same record, cut other ways: AI cost per ticket, Claude Code usage per developer, AI work audit trail, assign tickets to Claude Code and the Claude Code usage report.
Cite this page
Jenzo (2026). Claude Code observability: OpenTelemetry setup and what it misses. https://jenzo.ai/use-cases/claude-code-observability.
Free to quote with a link to this page.
Questions
How do I monitor Claude Code?
Turn on its OpenTelemetry export: set CLAUDE_CODE_ENABLE_TELEMETRY=1, choose OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER (otlp is the usual choice), point OTEL_EXPORTER_OTLP_ENDPOINT at your collector, and run claude. Check your backend for the claude_code.session.count metric to confirm it works. For a whole team, an admin sets the same variables once in Claude Code's managed settings.
What metrics does Claude Code export?
Eight: session count, lines of code modified, pull requests created, commits created, cost, tokens, code edit permission decisions and active time. It also emits 28 kinds of events, such as user_prompt, api_request, api_error, tool_result and tool_decision, and, in beta, traces that link each prompt to its API calls and tools.
Does Claude Code's telemetry include my prompts or code?
Not by default. Prompt content is redacted unless you set OTEL_LOG_USER_PROMPTS=1, and tool details, tool content, assistant responses and raw API bodies each have their own switch, all off by default.
Which tools can show Claude Code telemetry?
Any OpenTelemetry backend. SigNoz has a Claude Code monitoring guide with a dashboard, Sentry has a cookbook for it, and freeCodeCamp has a walk-through with Jaeger, Prometheus, Loki and Grafana. Claude Code can also expose metrics for Prometheus to scrape.
Can I see Claude Code cost per ticket in OpenTelemetry?
Not out of the box. Every metric and event carries the user, session and, if you turn it on, the repository, but no ticket. You can add one through OTEL_RESOURCE_ATTRIBUTES, but it is set when the process starts, so it stays wrong when a session moves to another ticket, and Anthropic warns that high-cardinality labels raise storage cost. Jenzo files each model call on the ticket the session is working on instead.
Is the cost in Claude Code's telemetry what I pay?
It is an estimate. The docs describe cost_usd as "Estimated cost in USD". On a subscription such as Max or Team, what you pay is the seat price, so treat the number as list-price usage, which is how Jenzo shows it too.
Does Jenzo replace Grafana, SigNoz or Datadog?
No. Keep your observability stack for health: errors, latency, retries, permission decisions. Jenzo is the work record: which ticket, which kind of work, who launched the session, what it decided and what it cost, across Claude Code, Codex, Cursor and Gemini CLI.