Improve telemetry instrumentation and error diagnostics for typespec-vscode#10847
Draft
RodgeFu wants to merge 10 commits into
Draft
Improve telemetry instrumentation and error diagnostics for typespec-vscode#10847RodgeFu wants to merge 10 commits into
RodgeFu wants to merge 10 commits into
Conversation
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
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.
Improve telemetry instrumentation and error diagnostics
Summary
Based on analysis of 2 weeks of telemetry data (71K+ events, 2,327 unique users), this PR improves telemetry instrumentation gaps and error diagnostics across the typespec-vscode extension and the compiler LSP server.
Changes
Extension telemetry improvements (
packages/typespec-vscode)install-tsp-compiler.ts— AddedlastSteptracking andlogOperationDetailTelemetryfor failure/timeout cases. Previously, all 3 install failures in the dataset hadlastStep=undefinedand zero error detail.openapi3-preview.ts— RefactoredgetOpenApi3OutputFilePathto returnResult<string>instead ofstring | undefinedto properly distinguish compile failures from user cancellations. AddedlastStepfor the success path ("Preview panel opened"). Added compile error details to telemetry.extension.ts(start-server) — AddedlastStepfor the "compiler not found" state before the install prompt, and for the cancelled-install path. These covered 66 events (34 fail + 32 cancelled) that previously hadlastStep=undefined.extension.ts(server-path-changed) — AddedlastStepfor the config change handler. All 30 events previously hadlastStep=undefined.Better error message for node/tsp not on PATH (
packages/typespec-vscode)tsp-executable-resolver.ts— When the compiler is found locally but neithernodenortspis available on PATH, the extension now shows an actionable error message explaining the likely cause (nvm/fnm/volta PATH not inherited) and three concrete fixes. Previously, this silently fell through tospawn tsp ENOENT. This was the #1 root cause of blocked users — 107 failure events from users who never recovered.Server-side error detail preservation (
packages/compiler)serverlib.ts— AddedwrapUnhandledErrorwrapper around all LSP server handlers. When a handler crashes, the wrapper catches the error and re-throws with the full server-side stack trace in the error message (viainspect(e)). Previously, the JSON-RPC layer only forwardederror.messageto the client, so the server-side crash location was completely lost in telemetry. This addresses the 297Cannot read properties of undefined (reading 'kind')errors that were previously opaque.Telemetry data highlights
start-serverin 2 weeksspawn tsp ENOENT(node not on PATH) — 107 events from never-recovered users, disproportionately macOS (60%)reading 'kind'unhandled errors — now will include server-side stack for future diagnosis