Telemetry counters (commit.count, pull_request.count) don't increment for multiple events within a session

Resolved 💬 2 comments Opened Jan 26, 2026 by CloudbrokerAz Closed Feb 28, 2026

Summary

The claude_code.commit.count and claude_code.pull_request.count telemetry counters do not increment when multiple commits or PRs are created within the same Claude Code session. The counter is set to 1 after the first event but remains at 1 for subsequent events.

Environment

  • Claude Code Version: 2.1.19
  • OS: macOS Darwin 25.2.0 (arm64)
  • Terminal: VS Code
  • Telemetry Backend: OpenTelemetry → OTLP Collector → Prometheus

Steps to Reproduce

  1. Enable telemetry with CLAUDE_CODE_ENABLE_TELEMETRY=1
  2. Start a Claude Code session
  3. Create a git commit via Claude Code (e.g., ask Claude to commit changes)
  4. Verify claude_code_commit_count_total metric shows value 1 in Prometheus
  5. Create additional commits in the same session
  6. Check the metric again - it still shows 1

Expected Behavior

The counter should increment with each commit/PR created:

  • After 1st commit: claude_code.commit.count = 1
  • After 2nd commit: claude_code.commit.count = 2
  • After 3rd commit: claude_code.commit.count = 3

Actual Behavior

The counter stays at 1 regardless of how many commits are made:

  • After 1st commit: claude_code.commit.count = 1
  • After 2nd commit: claude_code.commit.count = 1 (no change)
  • After 3rd commit: claude_code.commit.count = 1 (no change)

Evidence

Git log showing 3 commits made in session:

ba109c7 Merge pull request #1 from tfo-apj-demos/fix/dashboard-metric-names
37f3963 Fix Prometheus metric names in Claude Code dashboard
050301d Enhance Claude Code dashboard visualizations and fix panel issues

Prometheus time series data showing counter stuck at 1:

{
  "values": [
    [1769401080000, 1769401140000, 1769401200000, ...],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  ]
}

Session ID remained constant (same session):

session_id: fbc1e6e3-f383-4044-a275-9058025b119f

Additional Context

  • Other counters like claude_code.code_edit_tool.decision also appear to have similar behavior
  • No commit-related events appear in Loki logs when querying {service_name="claude-code"} |= "commit"
  • The claude_code.token.usage and claude_code.cost.usage counters DO increment correctly throughout the session

Impact

This makes it difficult to accurately track developer productivity metrics (commits created, PRs opened) when using Claude Code telemetry for monitoring dashboards.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗