Harness telemetry
How to get per-call usage out of each coding agent (harness) into the collector. Nothing else about the harness changes.
Coverage (tentative priority, not measured market share)
| Harness | Path | Status |
|---|---|---|
| Claude Code | native OTel: CLAUDE_CODE_ENABLE_TELEMETRY=1, OTEL_*; see claude-code-with-telemetry |
working |
| Codex CLI | native OTel: [otel] in ~/.codex/config.toml |
to verify |
| Gemini CLI | native OTel: telemetry block in settings.json |
to verify |
| GitHub Copilot | no per-call export known; org usage from GitHub Copilot metrics API | to verify |
| Cursor | no per-call export known; team usage and spend from Cursor admin API | to verify |
| Long tail: Windsurf, Cline/Roo, Aider, OpenCode, Amp, Kiro, Antigravity, Pi | local session logs (transcripts.md) or an LLM gateway |
to research |
Three paths, in order of preference:
- Native OTel from the harness: per call, most detail.
- LLM gateway (LiteLLM or a cloud AI gateway) between harness and model API: per call, works for any harness that uses an API key; blind to subscription plans.
- Vendor admin APIs or local session logs: per user and day, or per session after the fact.
Workflow
- Detect installed harnesses on the workstation.
- Pick the path per harness from the table.
- Write settings to per-user config files, not shell env; corporate rollouts ship them through the harness's managed/enterprise settings.
- Verify with one short prompt per harness.
Pitfalls
- Cost in telemetry is a list-price estimate. On flat subscriptions (Max, Team, seats) real spend comes from billing (
../04-auto-analysis/billing.md). - Harnesses drop telemetry silently when the endpoint is down.
- Attribute names change between harness versions; record the harness version with every record.
- Users can unset env vars; only managed settings make it stick.
- The same person shows up with a different identity per harness (vendor account email, GitHub handle); mapping in
../06-optional/identity.md. - Headless runs (CI, scheduled agents) have no human user; tag them as such (
../04-auto-analysis/deployments.md).