feat(telemetry): add export command#953
Open
EhabY wants to merge 1 commit into
Open
Conversation
35eba99 to
821a950
Compare
18ab98f to
5523f85
Compare
821a950 to
728e014
Compare
728e014 to
c450036
Compare
c450036 to
4daf2f8
Compare
ab7dcf4 to
acadd7e
Compare
4daf2f8 to
9534418
Compare
539131f to
fe6675e
Compare
25db18c to
d70fc4b
Compare
55cccf2 to
71bcce7
Compare
e762a74 to
1a94594
Compare
7ce5f22 to
d9f955a
Compare
1a94594 to
5439875
Compare
d9f955a to
f7308bf
Compare
541629e to
e31dd3e
Compare
f7308bf to
6ac4715
Compare
e31dd3e to
87b5f8d
Compare
3187fae to
4574a38
Compare
5bb2db1 to
6ccf541
Compare
96bd6f9 to
9951691
Compare
883cbb5 to
5bae441
Compare
263d0d1 to
593ee03
Compare
5bae441 to
e3bdba2
Compare
593ee03 to
d8aa467
Compare
227c58d to
581f2a3
Compare
d8aa467 to
4929d92
Compare
581f2a3 to
31ddd07
Compare
4929d92 to
22d73a9
Compare
Adds the "Coder: Export Telemetry" command that lets users save recorded telemetry as a JSON array or an OTLP/JSON zip. The flow prompts for a date range, a format, and a save location, then streams events from the on-disk sink through the chosen writer inside a cancellable progress notification. TelemetryService gains public getContext() and flush() methods so the command can attach an export-time snapshot to the OTLP zip and drain pending events before listing files. #emit routes through getContext() so the snapshot stays in sync with what events carry. Flush and file-listing run inside withCancellableProgress so the on-disk snapshot is taken right before streaming; the AbortSignal is threaded through the event iterator and into the OTLP writer. Reveal errors are swallowed locally so a missing revealFileInOS handler (web/remote hosts) does not report "Telemetry export failed" after a successful save. Writer failures show a single error notification instead of re-throwing into the wrapping command.invoked trace (which would leak the user's chosen save path via buildErrorBlock). Prompts set ignoreFocusOut so an accidental focus loss does not silently abort, and the custom-date prompt states the current UTC date explicitly. The empty-events case removes the empty output file and shows an info notification. Adds unit tests for command orchestration, TelemetryService.getContext / flush, plus a Uri.fsPath getter on the vscode test mock so fsPath template-literal interpolations stop rendering "undefined".
31ddd07 to
7416865
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coder.exportTelemetrycommand UI flowCommandManagerand package contributionsCloses #903.
Follow-up: #952 tracks adding recent local telemetry to support bundles.
Stack: 4 / 4. Base: #961.
Review follow-up
TelemetryService.flush()Validation
pnpm test:extension ./test/unit/telemetry/export/range.test.ts ./test/unit/telemetry/export/files.test.ts ./test/unit/telemetry/export/writers.test.ts ./test/unit/core/commandManager.test.tspnpm test:extensionpnpm typecheckpnpm lintpnpm format:checkpnpm buildGenerated by Coder Agents.