← Reddit

Open source Grafana dashboard for tracking your Claude Code costs and usage

Reddit · rockdarko · May 16, 2026
An SRE developed an open-source Grafana dashboard that leverages OpenTelemetry metrics to track Claude Code costs and usage across different dimensions such as model, project, and user, while also displaying token consumption, cache hit ratios, and code editing decisions. The dashboard integrates with Prometheus-compatible backends including Prometheus, VictoriaMetrics, Mimir, and Thanos, and supports custom labeling through OTEL_RESOURCE_ATTRIBUTES for team or project-based grouping. The MIT-licensed tool is available for download from Grafana Labs and on GitHub.

Detailed Analysis

A site reliability engineer has released an open-source Grafana dashboard designed to visualize cost and usage metrics from Anthropic's Claude Code, taking advantage of a relatively low-profile feature: the AI coding tool's native support for emitting OpenTelemetry (OTel) metrics. The dashboard, published under an MIT license and available directly through Grafana Labs (dashboard ID 25255), connects to any Prometheus-compatible backend — including VictoriaMetrics, Mimir, and Thanos — and surfaces a range of operational data including token consumption over time, cost breakdowns by model, project, and user, cache hit ratios, and developer activity metrics such as lines of code touched, commits, and pull requests opened by Claude Code. Custom labels can be applied via the `OTEL_RESOURCE_ATTRIBUTES` environment variable, enabling teams to group and filter telemetry by organizational unit or project namespace.

The dashboard's most significant capability from a cost-management perspective is its visibility into cache hit ratios, which the author explicitly identifies as "the single biggest lever on bill predictability." Claude's prompt caching mechanism substantially reduces token costs on repeated or similar inputs, and understanding how effectively that cache is being utilized — across users, projects, and models — gives engineering and platform teams a concrete operational handle on spend optimization. The inclusion of edit-decision breakdowns (accepted versus rejected suggestions) adds a layer of quality and productivity analytics that goes beyond pure financial tracking, offering organizations a rudimentary return-on-investment signal for their Claude Code deployments.

The project represents a meaningful moment in the maturation of AI developer tooling infrastructure. The fact that Claude Code ships with OpenTelemetry support at all reflects an industry-wide shift toward treating AI-assisted development tools as first-class production systems requiring the same observability primitives applied to any other service — metrics, tracing, and eventually logging. For enterprise and team deployments especially, the absence of cost attribution tooling has been a recurring friction point in AI tool adoption, and community-built solutions like this one help fill gaps that commercial vendors are only beginning to address natively. The author explicitly positions the dashboard as the open-source analog to an existing Azure Application Insights implementation (Grafana dashboard 25052), signaling that demand for this class of tooling spans both proprietary and open-source observability stacks.

More broadly, the release illustrates a pattern emerging around Anthropic's developer ecosystem: third-party builders are rapidly constructing infrastructure and tooling layers on top of Claude's programmatic interfaces, accelerating capabilities that Anthropic itself has not yet shipped as polished products. OpenTelemetry's vendor-neutral design makes this kind of community extension straightforward — any team already running a Prometheus-compatible stack can integrate Claude Code observability without additional vendor lock-in. As AI coding assistants move from individual productivity tools to team-wide and enterprise-wide deployments, the demand for cost governance, usage auditing, and productivity measurement will only intensify, making projects like this an early signal of what a mature AI development operations (AI DevOps) discipline will look like.

Read original article →