We've updated our Terms of Service and Privacy Policy. Please review the changes as you continue to interact with us.
Learn more
Plugins
Claude Code Stats logo

Claude Code Stats

timurdigital

Get plugin

Claude Code Stats

Team usage analytics for Claude Code powered by OpenTelemetry.

Requirements

  • Grafana 12.3.0 or later
  • A Prometheus-compatible data source (Grafana Cloud includes this by default)
  • Claude Code with telemetry enabled

Installation

Install the plugin through the Grafana UI: https://grafana.com/docs/grafana/latest/administration/plugin-management/plugin-install/#install-a-plugin-through-the-grafana-ui

Configuration

Step 1: Get Grafana Cloud OTLP Credentials

  1. Go to your Grafana Cloud Portal
  2. Select your stack and click Configure in the OpenTelemetry tile
  3. Click Generate API Token
  4. Copy the OTLP endpoint and token

Step 2: Configure Environment Variables

Add these to your shell profile (~/.zshrc, ~/.bashrc, or ~/.bash_profile):

# Enable Claude Code telemetry
export CLAUDE_CODE_ENABLE_TELEMETRY=1

# Configure OpenTelemetry metrics exporter
export OTEL_METRICS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"

# Grafana Cloud OTLP endpoint
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp-gateway-prod-<region>.grafana.net/otlp"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <your-base64-encoded-token>"

# IMPORTANT: Use cumulative temporality for Grafana Cloud compatibility
export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative

# Optional: Adjust export interval (in milliseconds, default: 60000)
export OTEL_METRIC_EXPORT_INTERVAL=60000

Replace <region> with your Grafana Cloud region and <your-base64-encoded-token> with your API token.

Step 3: Restart Claude Code

# Reload your shell config
source ~/.zshrc  # or ~/.bashrc

# Start Claude Code - telemetry will now be enabled
claude

Features

  • Overview: Total cost, tokens, sessions, and active users
  • Costs: Cost breakdown by model, team member, and time
  • Tokens: Token usage by type (input, output, cache)
  • Tools: Tool acceptance rates and usage
  • Productivity: Lines of code, commits, and active time
  • Environment: OS, architecture, and Claude Code version distribution

Team Members

Team members are automatically identified by their email address from the user_email label in the metrics.

Documentation

For full telemetry documentation, see the Claude Code Monitoring Usage Guide.

Plugin Insights

Quality scores for version 1.1.0

  • Status: Passed
    Security

    All checks passed

  • Status: Passed
    Maintenance

    All checks passed

  • Status: Passed
    Documentation

    All checks passed

Version
1.1.0
Dependencies
Grafana >=12.3.0
Developer
timurdigital
Last Updated
April 17, 2026