Grafana Cloud

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

  1. In your Grafana Cloud stack, click Connections in the left-hand menu.
  2. Find and select the Claude Code tile to open the integration.
  3. Follow the steps outlined on the Configuration page to set up telemetry and configure credentials.
  4. 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:

  1. Create Grafana Cloud Token

    • Generate a Grafana Cloud Access Policy Token with metrics:write and logs:write permissions.
    • Copy the token value and store it securely.
  2. Set Up Claude Code Telemetry

    Individual — Terminal (Quickstart)

    Add the following to your shell profile (.bashrc, .zshrc) or paste directly into your terminal:

    Bash
    export 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=cumulative

    Restart 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.

  3. 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)> where instanceId is your Hosted Metrics instance ID and token is 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

image

Claude Code usage breakdown

image

Claude Code productivity

image

Changelog

md
# 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 configurations