gitwtfhub

wtf is ai-coding-telemetry?

hanai/ai-coding-telemetry — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · ops devopsComplexity · 4/5Setup · hard

TL;DR

A self-hosted stack that tracks AI coding-tool usage and cost using OTLP telemetry, Grafana dashboards, and long-term metrics storage.

Mindmap

mindmap
  root((AI Telemetry Stack))
    What it does
      Tracks AI tool usage
      Computes cost at query time
      Self-hosted dashboards
    Tech stack
      Grafana Alloy
      VictoriaMetrics
      Loki
      Traefik
    Use cases
      Monitor Claude Code usage
      Monitor Codex usage
      Team cost tracking
    Audience
      DevOps engineers
      Platform teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Track token usage and cost across a team using Claude Code or Codex.

REASON 2

Self-host a Grafana dashboard for AI coding-tool spending instead of using a third-party service.

REASON 3

Ingest OTLP telemetry from any compatible AI tool for centralized monitoring.

What's in the stack?

PythonGrafanaGrafana AlloyVictoriaMetricsLokiDockerTraefik

How it stacks up

hanai/ai-coding-telemetry0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/52/54/5
Audienceops devopsgeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires Docker, an existing Traefik reverse proxy with TLS, and two DNS hostnames configured before startup.

Wtf does this do

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.

Yoink these prompts

Prompt 1
Help me set up this telemetry stack with Docker Compose and connect it to my existing Traefik proxy.
Prompt 2
Show me how to configure Claude Code to send OTLP telemetry to this stack.
Prompt 3
Explain how the cost dashboard calculates spend from raw token counts.
Prompt 4
Walk me through updating the token pricing file used by this stack.

Frequently asked questions

wtf is ai-coding-telemetry?

A self-hosted stack that tracks AI coding-tool usage and cost using OTLP telemetry, Grafana dashboards, and long-term metrics storage.

What language is ai-coding-telemetry written in?

Mainly Python. The stack also includes Python, Grafana, Grafana Alloy.

How hard is ai-coding-telemetry to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is ai-coding-telemetry for?

Mainly ops devops.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.