claude-code - 💡(How to fix) Fix [BUG] claude_code.commit.count, claude_code.lines_of_code.count and other metrics not emitted via OTLP

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Version: 2.1.136 Platform: macOS (darwin 25.4.0) Client: VS Code extension (also tested briefly via CLI — same result) OTel setup: OTLP HTTP/JSON exporter → working pipeline (confirmed via cost/token metrics flowing correctly)

What's working: claude_code.cost.usage (USD) claude_code.token.usage

Not emitted (never appear in AMP despite working pipeline): mmit.count claude_code.lines_of_code.count claude_code.code_edit_tool.decision claude_code.session.count claude_code.pull_request.count claude_code.active_time.total Confirmed working: cost/token metrics flow end-to-end proving the OTLP pipeline is functional.

Question: Are these metrics intended to be emitted via OTLP in the current release? If so, what conditions trigger them? If not, is there a target version?

CLAUDE_CODE_ENABLE_TELEMETRY=1, OTEL_METRICS_EXPORTER=otlp, export interval 5s.

What Should Happen?

All metrics listed in the documentation should be emitted via OTLP on the configured export interval (5s). Specifically, lines_of_code.count should increment when Claude Code edits files via its Edit tool, and commit.count should increment when Claude Code performs a git commit via its Bash tool.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce:

  1. Enable telemetry: CLAUDE_CODE_ENABLE_TELEMETRY=1, OTEL_METRICS_EXPORTER=otlp, OTEL_METRIC_EXPORT_INTERVAL=5000
  2. Point OTEL_EXPORTER_OTLP_METRICS_ENDPOINT to a working OTLP receiver
  3. Open Claude Code (VS Code extension or CLI)
  4. Ask Claude Code to edit a file using its Edit tool
  5. Ask Claude Code to commit the change via git
  6. Wait 10+ seconds for the export interval
  7. Check metrics backend: only claude_code.cost.usage and claude_code.token.usage appear

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.136

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING