Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/observe-and-act/monitor-infrastructure/integrations/integration-reference/integration-claude-code.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/observe-and-act/monitor-infrastructure/integrations/integration-reference/integration-claude-code/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Claude Code integration for Grafana Cloud
Track Claude Code usage, costs, and tool activity across your organization by exporting telemetry data through OpenTelemetry (OTel). Claude Code exports metrics as time series data through the standard metrics protocol, and events via the logs/events protocol.
Install Claude Code integration for Grafana Cloud
- In your Grafana Cloud stack, click Connections in the left-hand menu.
- Find and select the Claude Code tile to open the integration.
- Follow the steps outlined on the Configuration page to set up telemetry and configure credentials.
- After configuration is complete, click Install to add the prebuilt dashboards to your Grafana Cloud instance.
Configuration
The Claude Code integration sends metrics and logs to Grafana Cloud through OpenTelemetry (OTLP). You can configure telemetry for an individual developer or deploy it organization-wide through managed settings.
Configure the integration
Follow these steps to set up Claude Code for Grafana Cloud:
Create Grafana Cloud Token
- Generate a Grafana Cloud Access Policy Token with
metrics:writeandlogs:writepermissions. - Copy the token value and store it securely.
- Generate a Grafana Cloud Access Policy Token with
Set Up Claude Code Telemetry
Individual — Terminal (Quickstart)
Add the following to your shell profile (
.bashrc,.zshrc) or paste directly into your terminal:Bashexport CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=otlp export OTEL_LOGS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_ENDPOINT=<your-grafana-cloud-otlp-endpoint> export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <base64-encoded-instanceid:token>" export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulativeRestart Claude Code after updating your shell profile for changes to take effect.
Individual — Config File (Recommended)
Open
~/.claude/settings.json, or create it if it doesn’t exist, and add the following:JSON{ "env": { "CLAUDE_CODE_ENABLE_TELEMETRY": "1", "OTEL_METRICS_EXPORTER": "otlp", "OTEL_LOGS_EXPORTER": "otlp", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_EXPORTER_OTLP_ENDPOINT": "<your-grafana-cloud-otlp-endpoint>", "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Basic <base64-encoded-instanceid:token>", "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "cumulative" } }Restart Claude Code after saving the file for changes to take effect.
Administrator — Managed Settings
Administrators can configure OpenTelemetry settings for all users through the managed settings file, allowing centralized control of telemetry across an organization. For more information, refer to Settings precedence in the Claude Code documentation.
The managed settings file is located at:
- macOS:
/Library/Application Support/ClaudeCode/managed-settings.json - Linux / WSL:
/etc/claude-code/managed-settings.json - Windows:
C:\Program Files\ClaudeCode\managed-settings.json
Add the following to your managed settings file:
JSON{ "env": { "CLAUDE_CODE_ENABLE_TELEMETRY": "1", "OTEL_METRICS_EXPORTER": "otlp", "OTEL_LOGS_EXPORTER": "otlp", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_EXPORTER_OTLP_ENDPOINT": "<your-grafana-cloud-otlp-endpoint>", "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Basic <base64-encoded-instanceid:token>", "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "cumulative" } }You can distribute managed settings through MDM (Mobile Device Management) or other device management solutions. Environment variables defined in the managed settings file have high precedence and can’t be overridden by users. For deployment options, refer to Administrator configuration in the Claude Code documentation.
- macOS:
Install Dashboards
- Click Install to add the Claude Code dashboards to your Grafana Cloud instance.
Finding your credentials
- OTLP Endpoint: Your endpoint is displayed in the integration configuration page. You can also find it in the Grafana Cloud portal: select your stack, and then click Configure on the OpenTelemetry tile.
- Auth Header: Use
Authorization=Basic <base64(instanceId:token)>whereinstanceIdis your Hosted Metrics instance ID andtokenis the Grafana Cloud Access Policy token generated above.
Dashboards
The Claude Code integration installs the following dashboards in your Grafana Cloud instance.
- Claude Code
Claude Code stats

Claude Code usage breakdown

Claude Code productivity

Changelog
# 1.0.1 - October 2026
* Remove the nonexistent `claude settings` command, add the Windows managed settings path, and correct where to find the OTLP endpoint in the Grafana Cloud portal
# 1.0.0 - March 2026
* Initial release of Claude Code integration
* OTLP endpoint configuration for metrics and logs
* Setup instructions for individual (quickstart) and team/admin configurationsWas this page helpful?
Related resources from Grafana Labs


