[BUG] claude_code.commit.count, claude_code.lines_of_code.count and other metrics not emitted via OTLP
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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:
- Enable telemetry:
CLAUDE_CODE_ENABLE_TELEMETRY=1,OTEL_METRICS_EXPORTER=otlp,OTEL_METRIC_EXPORT_INTERVAL=5000 - Point
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTto a working OTLP receiver - Open Claude Code (VS Code extension or CLI)
- Ask Claude Code to edit a file using its Edit tool
- Ask Claude Code to commit the change via git
- Wait 10+ seconds for the export interval
- Check metrics backend: only
claude_code.cost.usageandclaude_code.token.usageappear
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_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗