lil-olt-metrics

A lightweight, single-binary metrics server with a built-in Claude Code dashboard. Track token usage, costs, activity patterns, and code impact from your AI coding workflow. Zero-config startup. No external dependencies.

Install Now See the Dashboard

Claude Code Dashboard

Built-in visualizations for Claude Code metrics, embedded directly in the binary. Point Claude Code's OTLP exporter at the server and open /dashboard/ to see your AI coding workflow at a glance.

Track everything about your AI coding sessions

The dashboard auto-refreshes every 30 seconds with configurable time ranges (24h, 7d, 30d, 90d). No Grafana setup required.

  • Token usage and cost breakdown by model
  • Activity heatmaps (hourly, weekday, calendar)
  • Commits, pull requests, and lines of code
  • Active time per session
  • Tool usage and code edit decisions by language

Tokens & Cost

Input, output, cache read, and cache creation tokens with dollar cost over time by model.

Activity Trends

Heatmaps showing when you code with Claude — by hour of day, day of week, and calendar view.

Code Impact

Track commits, pull requests created, and lines of code added or removed per session.

Session Analytics

Active time, session counts, tool accept/reject rates, and language distribution.

Quick setup

# 1. Install lil-olt-metrics curl -fsSL https://github.com/bobcob7/lil-olt-metrics/releases/download/v0.1.0/install.sh | sudo bash # 2. Enable Claude Code telemetry export # See: https://docs.anthropic.com/en/docs/claude-code/monitoring-usage export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 # 3. Open the dashboard open http://localhost:9090/dashboard/

Features

Claude Code Dashboard

Built-in dashboard at /dashboard/ visualizes token usage, costs, activity patterns, and code impact from Claude Code sessions.

OTLP Ingestion

gRPC and HTTP endpoints accept all OTLP metric types: Gauge, Sum, Histogram, ExponentialHistogram, and Summary.

Prometheus API

Full PromQL query engine. Drop-in Prometheus datasource for Grafana with instant, range, series, and label queries.

Single Binary

One static binary, no runtime dependencies. Runs anywhere: edge devices, dev machines, production servers.

Pluggable Storage

Built-in filesystem engine with WAL and compaction. Optional remote backends: Prometheus remote write, VictoriaMetrics.

Zero Config

Sensible defaults for everything. Just run the binary and it works. Customize later via YAML or environment variables.

Delta Conversion

Automatic delta-to-cumulative temporality conversion for OTel metrics that use delta aggregation.

Installation

Install with a single command. The script downloads the latest release binary, installs it, and sets up a system service.

curl -fsSL https://github.com/bobcob7/lil-olt-metrics/releases/download/v0.1.0/install.sh | sudo bash

Installs the binary to /usr/local/bin, creates a lom system user, writes a default config, and starts a systemd service.

curl -fsSL https://github.com/bobcob7/lil-olt-metrics/releases/download/v0.1.0/install.sh | sudo bash

Installs the binary to /usr/local/bin, writes a default config, and registers a launchd daemon. The script auto-detects macOS.

# Download the binary directly (no service setup) curl -fsSL https://github.com/bobcob7/lil-olt-metrics/releases/download/v0.1.0/install.sh | sudo bash -s -- --no-service # Or download manually for your platform curl -fsSL -o lil-olt-metrics \ https://github.com/bobcob7/lil-olt-metrics/releases/download/v0.1.0/lil-olt-metrics-linux-amd64 chmod +x lil-olt-metrics ./lil-olt-metrics

Available binaries: linux-amd64, linux-arm64, darwin-amd64, darwin-arm64.

Install a specific version

curl -fsSL https://github.com/bobcob7/lil-olt-metrics/releases/download/v0.1.0/install.sh \
  | sudo bash -s -- --version v0.1.0

Architecture

OTLP metrics flow in via gRPC or HTTP, get translated to the Prometheus data model, and are stored in a pluggable backend. The Prometheus API serves PromQL queries to clients like Grafana.

StagePackageDescription
Ingestioninternal/ingestgRPC and HTTP handlers for OTLP ExportMetricsServiceRequest
Translationinternal/ingestOTLP to Prometheus sample conversion with label mapping and unit suffixes
Storageinternal/storeAppender interface with filesystem, Prometheus, and VictoriaMetrics backends
Queryinternal/queryPrometheus HTTP API with embedded PromQL engine
Dashboardinternal/queryEmbedded Vue.js dashboard for Claude Code metrics visualization

Configuration

Configuration is loaded in order of precedence: environment variables (LOM_ prefix), YAML config file, then built-in defaults.

Default ports

PortProtocolDescription
4317gRPCOTLP metric ingestion
4318HTTPOTLP metric ingestion
9090HTTPPrometheus query API

Minimal YAML config

storage:
  fs:
    path: /var/lib/lil-olt-metrics

Remote backend example

storage:
  engine: prometheus
  prometheus:
    write_url: http://prometheus:9090/api/v1/write
    read_url: http://prometheus:9090/api/v1/read

Quick test

# Send test metrics
telemetrygen metrics --otlp-insecure --duration 10s

# Query via Prometheus API
curl 'http://localhost:9090/api/v1/query?query=up'

# List all metric names
curl 'http://localhost:9090/api/v1/label/__name__/values'

OTLP Support

FeatureStatus
GaugeSupported
Sum (Counter)Supported
HistogramSupported
ExponentialHistogramSupported
SummarySupported
Delta-to-cumulative conversionSupported
Resource attribute mappingSupported
Protobuf content typeSupported
JSON content typeSupported
gzip compressionSupported