Cc Metrics
Description
A Grafana dashboard for Claude Code otel metrics (dockerized)
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Claude Code Metrics Dashboard
A comprehensive monitoring stack for tracking Claude Code usage metrics, costs, and performance using OpenTelemetry, Prometheus, and Grafana.
Based on the [Sealos blog post](https://sealos.io/blog/claude-code-metrics).
Features
- Real-time Metrics Tracking: Monitor Claude Code sessions, token usage, costs, commits, and more
- Comprehensive Dashboard: 20+ panels showing key metrics, efficiency gauges, trends, and distributions
- Cost Analysis: Track costs by model, session, and time period
- Cache Efficiency Monitoring: Visualize prompt caching effectiveness
- Productivity Insights: Measure CLI vs user active time ratios
- Auto-provisioning: Dashboard and datasources automatically configured on startup
Architecture
Claude Code
↓ (OTLP HTTP/gRPC - metrics + logs)
OpenTelemetry Collector (:4318/:4317)
├─→ Prometheus metrics (:8889)
│ ↓
│ Prometheus (:9090)
└─→ JSON logs (file)
↓
Promtail
↓
Loki (:3100)
↓ (PromQL + LogQL queries)
Grafana (:3000)
↓ (Dashboard visualization)
Your Browser
Metrics Tracked
- Sessions: Total Claude Code session starts
- Tokens: Usage by type (input, output, cache_read, cache_creation) and model
- Costs: Estimated USD costs with per-model breakdown
- Code Changes: Lines added/removed from accepted edits
- Git Activity: Commits and pull requests created
- Edit Decisions: Accept/reject choices on code suggestions
- Active Time: User input time vs CLI processing time
- Prompt Length: Average character count of user prompts (via Loki logs)
Prerequisites
- Docker and Docker Compose
- Claude Code CLI
Quick Start
1. Clone or Download This Repository
cd cc-metrics
2. Set Up Data Directories
make setup
Or manually:
mkdir -p data/prometheus data/grafana data/loki data/otel-logs
chmod
Related Skills
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11