Repository navigation
chore(adapter/copilot): remove OpenTelemetry data source after #1174 #1208
Description
Activity
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
- added 20 commits that reference this issue
on Jun 5, 2026 - addedtriage:maintainableFits the repository's maintainable scope and needs review.Fits the repository's maintainable scope and needs review.
on Aug 31, 2026 Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: maintainable candidate. The request fits the current ccusage scope and can be evaluated with repository-owned code or fixtures, without vendor credentials or platform-specific release infrastructure. It remains closed for now; reopen only after confirming current relevance and expected behavior.
@jay-tau
I launch vscode from inside WSL2 and use copilot chat there, not the copilot CLI. Removing the OTel parser would leave me with no Copilot data in ccusage. vscode copilot chat doesn't write session-state files, so the OTel file exporter in its settings is the only local usage source.The table also says OTel has no AI-credit data. vscode chat spans carry copilot_chat.copilot_usage_nano_aiu, which the extension copies from the API response. It uses the same nano-AIU unit as session-state's totalNanoAiu. Here is a trimmed chat span with fake values, where 12,500,000,000 nano-AIU is 12.5 credits, or $0.125:
{ "name": "chat claude-opus-5.5", "traceId": "0123456789abcdef0123456789abcdef", "spanId": "0123456789abcdef", "endTime": [1790000000, 0], "attributes": { "gen_ai.operation.name": "chat", "gen_ai.response.model": "claude-opus-5.5", "gen_ai.conversation.id": "00000000-0000-0000-0000-000000000000", "gen_ai.usage.input_tokens": 50000, "gen_ai.usage.output_tokens": 500, "gen_ai.usage.cache_read.input_tokens": 40000, "gen_ai.usage.cache_creation.input_tokens": 9000, "copilot_chat.copilot_usage_nano_aiu": 12500000000 } }For vscode users, OTel is the only source of per-request credit cost. Please keep it.
What do you want to change?
Now that #1174 makes session-state the default Copilot data source, the OTel file-export path adds maintenance burden without giving users data they can't already get from session-state. Propose to delete the OTel parser, its env vars, and the OTel↔session-state coexistence dance in a follow-up PR.
Why?
After #1174, session-state is strictly more useful than OTel for ccusage's aggregation purposes:
totalNanoAiu(true AI-credit bill, post-2026-06-01)auto/credits/displayrequests.cost(pre-cutover premium-requests)autofor pre-cutover sessionsOTel's remaining advantages — per-call granularity and distributed-tracing context — are real, but ccusage surfaces none of them. Anyone who actually wants the per-call view should run a proper OTel pipeline (Jaeger, Tempo, an OTel collector), not file-export + ccusage.
What we pay to keep OTel after #1174:
COPILOT_OTEL_DEDUP=loose|strict|offenv var, invented specifically because we cannot verify whether OTel'ssession_id(resolved fromgen_ai.conversation.id/copilot_chat.session_id/session.id/github.copilot.interaction_id/gen_ai.response.idin priority order) matches the session-state directory UUID. Fragile and unverified by definition.COPILOT_PREFER_OTEL=1inversion that lets users opt in to the worse data source.Removing OTel closes both #1174 and #956 cleanly and eliminates the unverified ID-namespace assumption.
How? (optional)
rust/crates/ccusage/src/adapter/copilot/parser.rs(parse_otel_file,CopilotUsageSource,CandidateSets,to_candidate, theis_*_recordfamily, and the trace-context helpers).Otelvariant fromCopilotSourceinpaths.rsand dropCOPILOT_OTEL_FILE_EXPORTER_PATHreading.apply_coexistence_rulefromloader.rs; the loader iterates session-state files directly.COPILOT_OTEL_DEDUP_ENVandCOPILOT_PREFER_OTEL_ENVconstants and their tests.docs/guide/copilot/index.md,docs/guide/environment-variables.md, anddocs/guide/configuration.mdto drop OTel mentions.Breaking-change scope: users with OTel-only historical data and no session-state would lose the ability to analyze that data via ccusage. Realistic impact is small — session-state predates the AI-credits cutover and ships on every Copilot CLI install — but worth calling out in the changelog.
Refs #1174, #956