hanai/ai-coding-telemetry — explained in plain English
Analysis updated 2026-05-18
Track token usage and cost across a team using Claude Code or Codex.
Self-host a Grafana dashboard for AI coding-tool spending instead of using a third-party service.
Ingest OTLP telemetry from any compatible AI tool for centralized monitoring.
| hanai/ai-coding-telemetry | 0xallam/my-recipe | 0xhassaan/nn-from-scratch | |
|---|---|---|---|
| Stars | 0 | — | 0 |
| Language | Python | Python | Python |
| Last pushed | — | 2022-11-22 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | hard | moderate | moderate |
| Complexity | 4/5 | 2/5 | 4/5 |
| Audience | ops devops | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Docker, an existing Traefik reverse proxy with TLS, and two DNS hostnames configured before startup.
AI Telemetry Stack is a self-hosted set of tools for tracking how much you use AI coding assistants like Claude Code and Codex, and what that usage costs. Instead of relying on a third-party dashboard, you run this stack yourself and it collects and stores the data on your own infrastructure. The stack is made of several pieces working together. Grafana Alloy receives usage data sent by your AI tools using a standard format called OTLP, protected by a bearer token so only authorized clients can send data. VictoriaMetrics stores the numeric metrics, like token counts, for a very long time. Loki stores logs for sixty days. Grafana ties it all together with pre-built dashboards, including one specifically for AI usage and cost that combines raw token counts with a price list to calculate cost whenever you view it, rather than storing pre-calculated totals. To run the stack you need Docker with the Compose plugin installed, along with an existing Traefik reverse proxy, which is the only part exposed to the internet. Traefik needs a TLS entrypoint and a shared Docker network the stack can join. You also need two DNS hostnames, one for receiving telemetry data and one for the Grafana dashboard. Setup involves copying an example environment file, filling in your hostnames, a Grafana admin password, and a randomly generated ingest token, then starting everything with Docker Compose. Once running, Grafana becomes available at your chosen hostname, and AI tools can send their usage data to the telemetry hostname. Claude Code can be pointed at the stack by setting a handful of environment variables that enable telemetry and specify the endpoint and authorization header. Codex CLI supports the same kind of setup through its own configuration file. Token prices used for cost calculations are kept in a YAML file and loaded into VictoriaMetrics with a Python import script, so prices can be updated without touching the dashboards themselves. The project includes a test suite for the pricing logic, runnable with the uv tool.
A self-hosted stack that tracks AI coding-tool usage and cost using OTLP telemetry, Grafana dashboards, and long-term metrics storage.
Mainly Python. The stack also includes Python, Grafana, Grafana Alloy.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly ops devops.
This repo across BitVibe Labs
double-check against the repo, no cap.