diff --git a/src/client/startupTelemetry.ts b/src/client/startupTelemetry.ts index 544fb24251ef..5a2c12e2dd37 100644 --- a/src/client/startupTelemetry.ts +++ b/src/client/startupTelemetry.ts @@ -16,6 +16,7 @@ import { sendTelemetryEvent } from './telemetry'; import { EventName } from './telemetry/constants'; import { EditorLoadTelemetry } from './telemetry/types'; import { IStartupDurations } from './types'; +import { useEnvExtension } from './envExt/api.internal'; export async function sendStartupTelemetry( activatedPromise: Promise, @@ -105,9 +106,19 @@ async function getActivationTelemetryProps( // finish. API getActiveInterpreter() does not block on windows registry by default as // it is slow. await interpreterService.refreshPromise; - const interpreter = await interpreterService - .getActiveInterpreter() - .catch(() => undefined); + let interpreter: PythonEnvironment | undefined; + + // include main workspace uri if using env extension + if (useEnvExtension()) { + interpreter = await interpreterService + .getActiveInterpreter(mainWorkspaceUri) + .catch(() => undefined); + } else { + interpreter = await interpreterService + .getActiveInterpreter() + .catch(() => undefined); + } + const pythonVersion = interpreter && interpreter.version ? interpreter.version.raw : undefined; const interpreterType = interpreter ? interpreter.envType : undefined; if (interpreterType === EnvironmentType.Unknown) { diff --git a/src/client/terminals/codeExecution/codeExecutionManager.ts b/src/client/terminals/codeExecution/codeExecutionManager.ts index b1dc328d137e..d5eb69efba20 100644 --- a/src/client/terminals/codeExecution/codeExecutionManager.ts +++ b/src/client/terminals/codeExecution/codeExecutionManager.ts @@ -48,6 +48,9 @@ export class CodeExecutionManager implements ICodeExecutionManager { } catch (ex) { traceError('Failed to execute file in terminal', ex); } + sendTelemetryEvent(EventName.ENVIRONMENT_CHECK_TRIGGER, undefined, { + trigger: 'run-in-terminal', + }); return; }