---
title: "Troubleshooting - Claude Code Stats app plugin documentation"
description: "Troubleshoot common Claude Code Stats setup, data and access errors."
---

> This is the Markdown version of https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/troubleshooting/

# Troubleshooting

This page explains how to fix common issues when you set up or use Claude Code Stats. For setup instructions, refer to the [Introduction](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/).

## Missing data

These issues occur when the app loads but panels show **No data**.

### Every panel shows "No data"

**Symptoms:** All tabs load, but every panel shows **No data**.

**Possible causes and solutions:**

| Cause                                               | Solution                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Claude Code isn't exporting telemetry.              | Run `env \| grep -E '(CLAUDE\|OTEL)'` in the team member's shell and check the variables from [Connect your data](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/#connect-your-data) are set. Restart Claude Code after you change them.                                                                                                                                                                                                                                        |
| `OTEL_EXPORTER_OTLP_PROTOCOL` isn't set.            | The variable has no default, and without it Claude Code exports nothing. Set it to `http/protobuf`, as in [Connect your data](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/#connect-your-data).                                                                                                                                                                                                                                                                               |
| No metrics exported yet.                            | Claude Code exports metrics every 60 seconds by default. Use Claude Code for a few minutes, then reload the app.                                                                                                                                                                                                                                                                                                                                                                                       |
| The metric format doesn't match the ingestion path. | Query `claude_code_cost_usage` and `claude_code_cost_usage_USD_total` in **Explore**. If the first returns data, set **Ingestion path** to **Direct OTLP**. If the second does, set it to **Prometheus / OTEL Collector**. For details, refer to [Metric format](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/configure/#metric-format). The default is **Prometheus / OTEL Collector**, so if you followed the **Setup Guide** for Grafana Cloud, switch to **Direct OTLP**. |
| The wrong data source is selected.                  | Pick the data source that receives Claude Code metrics in the **Metrics** control at the top of the tab.                                                                                                                                                                                                                                                                                                                                                                                               |
| The time range has no usage.                        | Widen the time range.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

### No Prometheus data source to select

**Symptoms:** The **Metrics** control has no options.

**Solutions:**

1. Click **Connections** > **Data sources** in the left-side menu.
2. Check for a Prometheus data source. Grafana Cloud stacks include one, connected to Mimir, by default.
3. If there isn't one, add a Prometheus data source that points at the Prometheus or Mimir instance receiving Claude Code metrics.

### Some panels show "No data" or `custom`

**Symptoms:** Totals show data, but some panels are empty or only show `custom` or `third-party`.

**Possible causes and solutions:**

| Cause                                                                                                                   | Solution                                                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Nothing in the period used that feature, such as no subagents, skills, MCP tools, commits or edit decisions.            | No action needed. The panel fills in when the feature is used.                                                                                                                                                                |
| **Cost by Repository** or **Tokens by Repository** says to set `OTEL_METRICS_INCLUDE_REPOSITORY=true`.                  | Claude Code doesn't send repository attributes. Set the variable for team members. For details, refer to [Filter by repository](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/#filter-by-repository). |
| Claude Code redacts user-defined subagent, third-party skill and plugin, and user-configured MCP server and tool names. | Set `OTEL_LOG_TOOL_DETAILS=1` for team members. For details, refer to [Optional telemetry settings](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/#optional-telemetry-settings).                      |

### Event panels say to set `OTEL_LOGS_EXPORTER`

**Symptoms:** On the **Prompts**, **Workflow**, **Reliability** or **Security** tab, or in the tool performance panels on **Tools**, panels show `No events. Needs OTEL_LOGS_EXPORTER=otlp`.

On the counts, breakdowns and tables, the text means Loki has no Claude Code events at all for the period and filters. After events arrive, a count with nothing to count shows **0**, and a breakdown says what didn't happen, such as **No refusals in this period**.

Some panels need a particular event or measurement and show the text while it's missing, even when other events arrive:

- **Auto Compactions**, **Failed Compactions** and **Tokens Freed per Compaction** on **Workflow**, until a compaction happens
- **Cache Writes by Lifetime** on **Workflow**, until a request reports cache writes (Claude Code v2.1.300 or later)
- **Slash Command Share**, **Prompts per Session**, **Median Prompt Length** and **Prompt Length** on **Prompts**, until a prompt is sent

If other panels on the tab show data, events are reaching Loki and these panels only need that activity.

**Possible causes and solutions:**

| Cause                                 | Solution                                                                                                                                                                                                         |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Code isn't exporting events.   | Set `OTEL_LOGS_EXPORTER=otlp` for team members and restart Claude Code. For details, refer to [Send events to Loki](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/#send-events-to-loki). |
| The wrong data source is selected.    | Pick the Loki data source that receives Claude Code events in the **Events** control at the top of the tab.                                                                                                      |
| The filters or time range match none. | Set **Team Member** to **All** or widen the time range.                                                                                                                                                          |

### A team member shows as a random ID

**Symptoms:** A team member appears in **Team Member** and the per-member panels as a long random string instead of an email address.

**Solutions:**

Claude Code sends an email address only when the member signs in with a Claude account. With an API key, Amazon Bedrock, Google Cloud or Microsoft Foundry, the app falls back to the anonymous ID Claude Code generates for each machine. Set `enduser.id` for that member to show a readable name, as described in [Name team members who don't sign in with a Claude account](https://grafana.com/grafana/plugins/timurdigital-claudestats-app/docs/#name-team-members-who-dont-sign-in-with-a-claude-account). A member who uses several machines appears once per machine until `enduser.id` is set.

## Export errors

These issues occur when Claude Code can't deliver metrics to Grafana Cloud.

### Authentication errors

**Symptoms:** No data arrives, and the OTLP endpoint rejects requests from Claude Code.

**Possible causes and solutions:**

| Cause                                   | Solution                                                                                                                                                                                                        |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The credential isn't encoded correctly. | The value after `Authorization=Basic` in `OTEL_EXPORTER_OTLP_HEADERS` must be the Base64 encoding of `<instance-id>:<token>`, not the token alone. Copy it from the headers the Grafana Cloud portal generates. |
| The token can't write OTLP data.        | Generate a token with OTLP write permission from the **OpenTelemetry** tile in the Grafana Cloud portal.                                                                                                        |
| The endpoint is for another region.     | Copy the endpoint from your stack's **OpenTelemetry** tile.                                                                                                                                                     |

## Get more detail about an error

For errors in the app, open the developer tools in your browser and check the console.

## Get additional help

If this page doesn't solve your problem:

- Search the [Grafana community forums](https://community.grafana.com/).
- If your Grafana Cloud or Grafana Enterprise plan includes support, contact Grafana Support.
- Search or open an issue in the [Claude Code Stats issue tracker](https://github.com/tolzhabayev/claudestats-app-grafana/issues).
- For Claude Code telemetry settings, refer to [Monitoring usage](https://code.claude.com/docs/en/monitoring-usage) in the Claude Code docs.

When you report an issue, include:

- The Grafana and plugin versions.
- The error message, with sensitive information removed.
- The steps to reproduce the issue.
- The app page where it happens and the relevant app settings, with credentials removed.
