You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f9e6386
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(adapter/copilot): remove legacy OTel parser and its tests
The production loader has been reading session-state events.jsonl
exclusively since the start of this PR series. The OTel parser had
been carried under #[allow(dead_code)] pending ccusage#1208, but ccusage#1208 was
auto-closed by the contribution gate, so folding the removal in here
avoids leaving an orphaned dead-code parser with no tracked owner.
Removed
-------
* parse_otel_file and ~500 lines of OTel-specific helpers
(CopilotUsageSource, CopilotUsageCandidate, trace context
collection, span/log classification, OTel attribute readers,
span-id/trace-id extraction, OTel timestamp parsers).
* 4 OTel parser tests in loader.rs::tests
(parses_copilot_chat_spans, suppresses_lower_priority_records_*,
includes_reasoning_tokens_in_total_tokens,
falls_back_to_total_tokens_when_copilot_parts_are_missing).
* Now-unused imports: HashSet, serde_json::Map, apply_total_token_fallback,
TokenUsageRaw (parser.rs); fs_fixture, parse_otel_file, AgentReportKind,
report_from_rows, summarize_entries (loader.rs).
* OTel-mentioning doc fragments in nano_aiu, premium_request_cost,
the loader's mode-dispatch comment, the OTel-coexistence-tests
placeholder, and the per-file-isolation test header.
* The "Legacy OpenTelemetry parser" README section.
Retained (intentionally)
------------------------
* file_modified_timestamp helper (moved into the session-state
section; used by parse_session_state_file's fallback timestamp).
* The OTel env-var deprecation warning surface
(warn_about_inert_legacy_env_vars_once, LEGACY_OTEL_ENV_VARS,
legacy_otel_env_vars_in_use) and its tests. This is the user-facing
notice on first run after upgrade; users who had
COPILOT_OTEL_FILE_EXPORTER_PATH / COPILOT_OTEL_DEDUP /
COPILOT_PREFER_OTEL set still need to learn those are inert.
* The otel/ directory ignore tests (paths.rs) and the README section
documenting the env-var deprecation.
Validation
----------
* cargo fmt --check clean.
* cargo clippy --workspace --all-targets -- -D warnings clean.
* cargo test --workspace: 364 passed, 0 failed (was 368: -4 OTel
parser tests). All session-state tests, all aggregation tests, and
the env-var deprecation tests continue to pass.
Diff: 4 files changed, +30 / -711 lines.
Co-authored-by: Copilot <[email protected]>
0 commit comments