Add telemetry for manager registration failures by StellaHuang95 · Pull Request #1365 · microsoft/vscode-python-environments

Adds telemetry to diagnose why environments sometimes fail to appear for users. Currently we do not know what went wrong or what's missing.

New telemetry events

  • MANAGER_REGISTRATION.FAILED — Fires when a manager throws an unexpected error during registration. Tells us which managers fail and the classified error type.

  • MANAGER_REGISTRATION.SKIPPED — Fires when a manager's tool (conda/pyenv/pipenv/poetry) wasn't found on the system. Tells us which managers are commonly unavailable, helping us understand user environments. Without SKIPPED, we'd only see that a manager didn't register. We couldn't tell whether that's because the user doesn't use conda (fine, nothing to fix) or because conda is installed but our code crashed trying to register it (bug).

  • SETUP.HANG_DETECTED — Fires when the entire setup block hasn't completed within 120s. Tells us which stage was in progress when the hang occurred (nativeFinder, managerRegistration, envSelection, etc.).

Enhanced existing event

  • EXTENSION_MANAGER_REGISTRATION_DURATION now includes result (success/error), failureStage, and errorType — previously it only reported duration.

Non-telemetry changes

  • Conda registration refactor: Separated the "conda not found" path (try/catch on getConda) from the registration path, so SKIPPED vs FAILED telemetry is accurate. Post-getConda errors still call notifyMissingManagerIfDefault and re-throw for safeRegister to handle.
  • safeRegister in asyncUtils.ts: Now sends MANAGER_REGISTRATION.FAILED telemetry when a manager's promise rejects, so failures are captured even when individual managers don't add their own telemetry.