Plugins 〉Claude Code Stats
Claude Code Stats
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
- Go to your Grafana Cloud Portal
- Select your stack and click Configure in the OpenTelemetry tile
- Click Generate API Token
- 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.
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing Claude Code Stats on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Warning
Plugin installation from this page will be removed in February 2026. Use the Plugin Catalog in your Grafana instance instead. Refer to Install a plugin in the Grafana documentation for more information.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Warning
Plugin installation from this page will be removed in February 2026. Use the Plugin Catalog in your Grafana instance instead. Refer to Install a plugin in the Grafana documentation for more information.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Warning
Plugin installation from this page will be removed in February 2026. Use the Plugin Catalog in your Grafana instance instead. Refer to Install a plugin in the Grafana documentation for more information.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Warning
Plugin installation from this page will be removed in February 2026. Use the Plugin Catalog in your Grafana instance instead. Refer to Install a plugin in the Grafana documentation for more information.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Warning
Plugin installation from this page will be removed in February 2026. Use the Plugin Catalog in your Grafana instance instead. Refer to Install a plugin in the Grafana documentation for more information.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Warning
Plugin installation from this page will be removed in February 2026. Use the Plugin Catalog in your Grafana instance instead. Refer to Install a plugin in the Grafana documentation for more information.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Application
Use the grafana-cli tool to install Claude Code Stats from the commandline:
grafana-cli plugins install The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Enable it
Next, log into your Grafana instance. Navigate to the Plugins section, found in your Grafana main menu.
Click the Apps tabs in the Plugins section and select the newly installed app.
To enable the app, click the Config tab. Follow the instructions provided with the application and click Enable. The app and any new UI pages are now accessible from within the main menu, as designed by the app creator.
If dashboards have been included with the application, they will attempt to be automatically installed. To view the dashboards, re-import or delete individual dashboards, click the Dashboards tab within the app page.
Changelog
1.0.2
Changed
- Use
user_emaillabel instead ofuser_account_uuidfor team member identification - Added
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulativeto setup guide (required for Grafana Cloud) - Improved browser tab titles for better navigation
- Simplified configuration page (removed Team Members tab, users are now identified by email automatically)
Added
- End-to-end tests with Playwright
.nvmrcfile for consistent Node.js version
CI
- Bump actions/checkout from 5 to 6
- Bump actions/setup-node from 6.0.0 to 6.1.0
- Bump actions/upload-artifact from 5 to 6
- Bump actions/download-artifact from 6 to 7
- Bump grafana/plugin-actions/bundle-size from 1.0.2 to 1.1.0
1.0.0
Initial release of Claude Stats Grafana app plugin.
Features
- Overview dashboard with cost, token, and session metrics
- Cost analytics with breakdown by model and team member
- Token usage analysis with input/output/cache breakdown
- Tool usage tracking with accept/reject decisions
- Productivity metrics (lines of code, commits, PRs)
- Setup wizard for configuring Claude Code OpenTelemetry export
- Team member filtering across all dashboards
- Auto-discovery of Prometheus data sources




