Skip to content

Telemetry: instrument workspace and diagnostic command workflows #986

@EhabY

Description

@EhabY

Follow-up from the local telemetry audit of #953 / #903.

Scope

Main already has broad command.invoked coverage for user commands plus workspace/agent state transition telemetry. Keep this issue focused on workflows where commands return normally on cancellation/failure or where user decisions are invisible.

Add a small number of traces/events for:

  • workspace picker summary: opened, final result count, selected/cancelled/failed outcome, selected workspace state/agent counts, and duration
  • workspace open handoff: one workspace.open trace covering open and openFromSidebar, with source, workspace/agent state buckets, selected/cancelled/failed result, and duration
  • devcontainer open handoff: one workspace.devcontainer.open trace with mode/category, result, bounded failure category, and duration
  • start/update prompt decisions: trace prompt shown and final accepted/dismissed/cancelled result; keep this compact and attach to existing start/update operation telemetry where practical
  • diagnostic command outcomes for speedTest, supportBundle, and coder.exportTelemetry, using one trace per command with success/failure/cancelled result and bounded summary measurements

This continues to exclude Tasks panel instrumentation because the Tasks panel is being deprecated.

Avoid duplicating

  • command.invoked already records command ID, duration, and thrown errors for all coder.* commands.
  • workspace.state_transitioned and workspace.agent.state_transitioned already record workspace/agent state changes.
  • workspace.start.triggered, workspace.update.prompted, and workspace.update.triggered already cover parts of remote start/update.
  • Do not emit a search event for every picker keystroke; if search telemetry is needed, emit one final/debounced summary only.
  • Do not add workspace.ping.succeeded; pingWorkspace launches a terminal command and does not wait for ping completion. Use workspace.ping.launched only if needed.

Privacy

Do not log raw workspace names, search queries, local paths, export paths, or devcontainer paths unless a separate privacy/export decision explicitly allows it. Use counts, source/category enums, state buckets, and durations.

Acceptance criteria

  • User cancellation vs failure vs success is distinguishable for workspace picker/open/devcontainer flows where command.invoked is insufficient.
  • Diagnostic command outcomes are visible without recording output paths or raw command output.
  • Workspace start/update prompt decisions are visible without duplicating existing start/update traces.
  • Picker telemetry is low-volume and privacy-safe.
  • Tasks panel instrumentation is not included.
  • Tests cover representative success, cancellation, and failure paths.

Generated by Coder Agent from the telemetry audit of #953. Updated after reviewing existing telemetry on main.

Metadata

Metadata

Assignees

Labels

enhancementtelemetryTelemetry and observability instrumentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions