Real-time Metrics Export
TheMetricsExporter provides per-agent metrics in Prometheus, JSON, and real-time streaming formats.
Setup
REST Endpoints
| Endpoint | Format | Description |
|---|---|---|
GET /metrics | Prometheus text | Scrape-ready for Prometheus/Grafana |
GET /metrics/json | JSON | Dashboard-friendly JSON |
GET /metrics/json?agent=bot | JSON | Per-agent metrics |
GET /metrics/stream | SSE | Real-time event stream |
Available Metrics
- runs — total agent runs
- errors — total errors
- avgDurationMs — average run duration
- p95DurationMs — 95th percentile latency
- totalCost — accumulated USD cost
- totalTokens — total tokens consumed
- toolCallCount — total tool invocations
- toolUsageFrequency — per-tool call counts
- errorRate — error ratio
- tokensPerRun — average tokens per successful run