feat: add workflow telemetry traces#995
Merged
Merged
Conversation
13ac369 to
fc8b81d
Compare
mtojek
reviewed
Jun 10, 2026
e825971 to
78285e9
Compare
Split instrumentation/commands.ts into workspaceOpen.ts, diagnostics.ts, and shared outcomes.ts to mirror a future commands.ts split. Unify trace methods on the cancel/fail/succeed* trio, shorten trace<Noun> names, and make ExportTelemetryObserver a required structural subset of DiagnosticTrace so callers pass their trace directly. Commands now keep business bodies in named run* methods instead of inline closures, the open source defaults to "command" rather than being inferred from argument presence, and the dead openWorkspace wrapper is gone. Restore workspaceName on workspace.update.prompted and workspace.start.prompted to match the other operation traces. Rename the telemetry-only test to updateWorkspace.telemetry.test.ts.
Rename the Commands openTelemetry field to workspaceOpenTelemetry so it mirrors its class like the sibling fields (and stops reading like the OpenTelemetry framework), group the three telemetry helpers together in the constructor, and rename AuthTelemetry.traceAuthRecovery to traceRecovery to drop the qualifier the class already implies.
Address review feedback and standardize span outcome vocabulary: - Rename failure -> error (markError, error.type, *ErrorCategory) to match the OTel span status and the error.type semantic convention. - Unify cancellation on "abort" across the telemetry layer; the VS Code cancellation mirrors (CancellationToken, ProgressResult) stay as-is. - OTLP export: map aborted spans to UNSET and backfill error.type on error spans from the exception type/code, falling back to OTel's _OTHER. - DevContainer casing, type-safe start/update button captions, and test cleanups (shared open defaults, multi-connected-agent coverage).
78285e9 to
c0057d7
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.
Generated by Coder Agents.
Fixes #986.
Summary
command.invokedcoverage while marking normally-returned cancellation/failure paths with bounded categoriesValidation
pnpm test:extension ./test/unit/instrumentation/commands.test.ts ./test/unit/instrumentation/workspace.test.ts ./test/unit/telemetry/export/command.test.ts ./test/unit/uri/uriHandler.test.tspnpm format:checkpnpm lintpnpm typecheckgit diff --checkImplementation plan
Issue 986 telemetry implementation plan
Goal
Add the missing low-volume, privacy-safe telemetry for issue #986 without duplicating existing
command.invoked, workspace state transition, or start/update operation telemetry.Principles
command.invokedas the broad command coverage signal.TelemetryService.trace:result=successfor completed/accepted/selected paths.result=abortedfor user cancellation/dismissal.result=errorfor thrown or handled failures, usingspan.markFailure()when the command handles the error and returns.command.invoked,workspace.update.prompted, andworkspace.start.triggered.Event plan
Existing event retained
command.invokedWorkspace picker
workspace.picker.promptedsuccesswhen a workspace is selected,abortedwhen dismissed,errorwhen fetching/searching fails.Workspace open handoff
workspace.openopenandopenFromSidebarhandoff to VS Code.source, workspace/build/agent state buckets, handoff category.successwhen VS Code open handoff succeeds,abortedwhen the user cancels workspace/agent/recent-folder selection,errorwhen the handoff fails.Devcontainer open handoff
workspace.devcontainer.opensuccessorerror.Start/update prompt decisions
workspace.start.promptedsuccesswhen a choice is accepted,abortedwhen dismissed.workspace.update.promptedDiagnostic command outcomes
command.diagnostic.completedcoder.speedTest,coder.supportBundle, andcoder.exportTelemetry.commandIdplus bounded outcome/failure category where useful.success,aborted, orerrorusingspan.markAborted()/span.markFailure()for handled outcomes.Test plan
test/unit/instrumentation/workspace.test.tsfor prompt telemetry behavior.test/unit/telemetry/export/command.test.tsfor export diagnostic outcomes.pnpm typecheckor targeted typechecking if needed.