
What You Get
The pre-built Grafana dashboard gives you per-agent and per-project visibility into:- Cost and token usage — API call costs, input/output tokens, rate limiting
- Coding activity — file edits, tool invocations, command executions
- Tool usage — which tools the agent calls, how often, and how long they take
- Session detail — full event timeline for individual agent sessions




Architecture
The monitoring stack runs as five Docker Compose services on theclawker-net network:
Services
| Service | Image | Default Port | Purpose |
|---|---|---|---|
| OTEL Collector | otel/opentelemetry-collector-contrib | 4318 (HTTP), 4317 (gRPC) | Receives telemetry from agents and routes it to storage backends |
| Prometheus | prom/prometheus | 9090 | Time-series metrics storage — resource utilization, request counts, durations |
| Loki | grafana/loki | 3100 | Log aggregation — structured events with tool details, prompts, decisions |
| Jaeger | jaegertracing/all-in-one | 16686 | Distributed tracing — collector pipeline is configured but agents don’t emit traces yet |
| Grafana | grafana/grafana | 3000 | Unified dashboards — pre-configured with all data sources and a Claude Code dashboard |
clawker-net network. Grafana starts with anonymous login enabled (no credentials required) and data sources pre-provisioned.
How Agents Connect
OTEL endpoints are baked into every Clawker image at build time. At container creation, Clawker checks whether the monitoring stack is running and conditionally enables telemetry:OTEL_EXPORTER_OTLP_METRICS_ENDPOINT— points to the collector’s metrics endpoint (baked into image)OTEL_EXPORTER_OTLP_LOGS_ENDPOINT— points to the collector’s logs endpoint (baked into image)CLAUDE_CODE_ENABLE_TELEMETRY— set to1when theotel-collectorcontainer is detected as running onclawker-net, set to0otherwiseOTEL_RESOURCE_ATTRIBUTES— tags withproject=andagent=for filtering
agent.env in your .clawker.yaml even when the stack is down, but Claude Code won’t retry failed collector connections.
Start the monitoring stack before starting your agents to ensure telemetry is captured.
Setup
1. Initialize Configuration
~/.local/share/clawker/monitor/):
compose.yaml— Docker Compose definition for all five servicesotel-config.yaml— OpenTelemetry Collector pipeline configurationprometheus.yaml— Prometheus scrape targetsgrafana-datasources.yaml— Auto-provisioned Grafana data sourcesgrafana-dashboards.yaml— Dashboard provisioning configgrafana-dashboard.json— Pre-built Claude Code dashboard
--force to regenerate files if they already exist.
2. Start the Stack
3. Run Agents
Start agents as usual — telemetry flows automatically:4. View Dashboards
Open Grafana athttp://localhost:3000. The pre-configured Claude Code dashboard shows metrics and logs with per-project and per-agent filtering.
Telemetry Controls
Fine-tune what telemetry is collected viasettings.yaml:
Port Configuration
Override default ports insettings.yaml if they conflict with other services:
Checking Status
Teardown
--volumes, monitoring data persists across restarts. The clawker-net network is preserved for other Clawker services (firewall, agents).