Jenzo · Use case

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), point OTEL_EXPORTER_OTLP_ENDPOINT at your collector and start claude. The block below is Anthropic's quick start (docs), plus the beta traces switch.
Check it
Look for the claude_code.session.count metric in your backend; Claude Code sends it when a session starts. For a logs-only setup, send a prompt and look for claude_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.json are 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.

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.

MetricWhat it countsUnit
claude_code.session.countCount of sessions startednone
claude_code.lines_of_code.countCount of lines of code modifiednone
claude_code.pull_request.countNumber of pull requests creatednone
claude_code.commit.countNumber of git commits creatednone
claude_code.cost.usageCost of the Claude Code sessionUSD
claude_code.token.usageNumber of tokens usedtokens
claude_code.code_edit_tool.decisionCount of code editing tool permission decisionsnone
claude_code.active_time.totalTotal active times

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.

user_promptassistant_responsetool_resultapi_requestapi_errorapi_refusalapi_request_bodyapi_response_bodytool_decisionsafety_eventpermission_mode_changedauthmcp_server_connectioninternal_errorplugin_installedplugin_loadedskill_activatedat_mentionapi_retries_exhaustedhook_registeredhook_execution_starthook_execution_completehook_plugin_metricscompactionsubagent_completedfeedback_surveyretention_sweepmanaged_settings_resolved

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.

Ticket as an OTel attribute
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.

Ticket from the work itself
> 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.

Health

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.

Usage

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.

Work

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.

1 · One ticket

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.

Jenzo AI work panel on a ticket: $6.15 AI cost at API prices, measured, 1h 01m AI working time, 9m paused waiting on people, 18.7M tokens, exact token usage for claude-opus-5-5 and claude-sonnet-5-5, two Claude Code sessions launched by Sam WhitakerJenzo AI work panel on a ticket: $6.15 AI cost at API prices, measured, 1h 01m AI working time, 9m paused waiting on people, 18.7M tokens, exact token usage for claude-opus-5-5 and claude-sonnet-5-5, two Claude Code sessions launched by Sam Whitaker
AI work on one ticket, recorded by the Jenzo plugin. Demo workspace.
2 · Every tool

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.

Jenzo Where the money went, by harness: Claude Code $88.72 on 32 tickets, Codex $53.72 on 15 tickets with $6.70 not on a ticket, Cursor about $34.30 estimated, Gemini CLI $14.66, $191 AI spendJenzo Where the money went, by harness: Claude Code $88.72 on 32 tickets, Codex $53.72 on 15 tickets with $6.70 not on a ticket, Cursor about $34.30 estimated, Gemini CLI $14.66, $191 AI spend
AI spend by tool, each slice opens on its tickets. Demo workspace.

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.

OptionForPer personPer repoPer ticketTools covered
OpenTelemetry to your backendAny team that runs a collectorYes (user.email, user.id)Opt-inOnly with a launch-time attributeClaude Code only
Claude Code analytics dashboardTeams and EnterpriseYesContributions, GitHub reposNoClaude Code only
/usage and local toolsOne personOnly yourselfNoNoOne tool at a time
JenzoAny teamYes, who launched each sessionYes (project folder)Yes, per model callClaude 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

1

Keep your OTel export

Nothing to undo. Jenzo reads the local transcript after each session and sends counts only, alongside whatever you already export.

2

Install the Jenzo plugin

One command in Claude Code. It adds the MCP server and the usage hook.

3

Work on tickets

Say "work on HAL-69" or let Claude Code ask what is next. Each model call lands on that ticket.

Claude Code, plugin (MCP plus usage)
claude plugin marketplace add https://app.jenzo.ai/claude/marketplace.json
claude plugin install jenzo@jenzo --config token=YOUR_TOKEN
Then
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.