From 170ec9e6db24a39ad96837ec74ffba975e99f1e7 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Fri, 7 Mar 2025 09:52:25 -0800 Subject: [PATCH 1/2] revert changes to add new telemetry event --- src/extension/noConfigDebugInit.ts | 3 --- src/extension/telemetry/constants.ts | 1 - src/extension/telemetry/index.ts | 8 -------- 3 files changed, 12 deletions(-) diff --git a/src/extension/noConfigDebugInit.ts b/src/extension/noConfigDebugInit.ts index f9787d76..840ea3ad 100644 --- a/src/extension/noConfigDebugInit.ts +++ b/src/extension/noConfigDebugInit.ts @@ -14,8 +14,6 @@ import { } from 'vscode'; import { createFileSystemWatcher, debugStartDebugging } from './utils'; import { traceError, traceVerbose } from './common/log/logging'; -import { sendTelemetryEvent } from './telemetry'; -import { EventName } from './telemetry/constants'; /** * Registers the configuration-less debugging setup for the extension. @@ -86,7 +84,6 @@ export async function registerNoConfigDebug( // create file system watcher for the debuggerAdapterEndpointFolder for when the communication port is written const fileSystemWatcher = createFileSystemWatcher(new RelativePattern(tempDirPath, '**/*')); const fileCreationEvent = fileSystemWatcher.onDidCreate(async (uri) => { - sendTelemetryEvent(EventName.DEBUGGER_NO_CONFIG_DEBUGGING); const filePath = uri.fsPath; fs.readFile(filePath, (err, data) => { const dataParse = data.toString(); diff --git a/src/extension/telemetry/constants.ts b/src/extension/telemetry/constants.ts index e8a55d2d..94ff6643 100644 --- a/src/extension/telemetry/constants.ts +++ b/src/extension/telemetry/constants.ts @@ -24,5 +24,4 @@ export enum EventName { USE_REPORT_ISSUE_COMMAND = 'USE_REPORT_ISSUE_COMMAND', DEBUGGER_PYTHON_37_DEPRECATED = 'DEBUGGER_PYTHON_37_DEPRECATED', DEBUGGER_SHOW_PYTHON_INLINE_VALUES = 'DEBUGGER_SHOW_PYTHON_INLINE_VALUES', - DEBUGGER_NO_CONFIG_DEBUGGING = 'DEBUGGER_NO_CONFIG_DEBUGGING', } diff --git a/src/extension/telemetry/index.ts b/src/extension/telemetry/index.ts index cbd34467..2aeaa406 100644 --- a/src/extension/telemetry/index.ts +++ b/src/extension/telemetry/index.ts @@ -690,12 +690,4 @@ export interface IEventNamePropertyMapping { "DEBUGGER_SHOW_PYTHON_INLINE_VALUES" : { "owner": "eleanorjboyd" } */ [EventName.DEBUGGER_SHOW_PYTHON_INLINE_VALUES]: never | undefined; - - /** - * Telemetry event sent when no-config debugging is used. - */ - /* __GDPR__ - "DEBUGGER_NO_CONFIG_DEBUGGING" : { "owner": "eleanorjboyd" } - */ - [EventName.DEBUGGER_NO_CONFIG_DEBUGGING]: never | undefined; } From 95104800474a68dcd59e439c90e1c97bfa226f81 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Fri, 7 Mar 2025 09:54:07 -0800 Subject: [PATCH 2/2] switch to use DEBUG_SESSION_START event with new trigger type --- src/extension/noConfigDebugInit.ts | 7 +++++++ src/extension/telemetry/index.ts | 1 + src/extension/types.ts | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/extension/noConfigDebugInit.ts b/src/extension/noConfigDebugInit.ts index 840ea3ad..4962abe5 100644 --- a/src/extension/noConfigDebugInit.ts +++ b/src/extension/noConfigDebugInit.ts @@ -14,6 +14,9 @@ import { } from 'vscode'; import { createFileSystemWatcher, debugStartDebugging } from './utils'; import { traceError, traceVerbose } from './common/log/logging'; +import { sendTelemetryEvent } from './telemetry'; +import { EventName } from './telemetry/constants'; +import { TriggerType } from './types'; /** * Registers the configuration-less debugging setup for the extension. @@ -84,6 +87,10 @@ export async function registerNoConfigDebug( // create file system watcher for the debuggerAdapterEndpointFolder for when the communication port is written const fileSystemWatcher = createFileSystemWatcher(new RelativePattern(tempDirPath, '**/*')); const fileCreationEvent = fileSystemWatcher.onDidCreate(async (uri) => { + sendTelemetryEvent(EventName.DEBUG_SESSION_START, undefined, { + trigger: 'noConfig' as TriggerType, + }); + const filePath = uri.fsPath; fs.readFile(filePath, (err, data) => { const dataParse = data.toString(); diff --git a/src/extension/telemetry/index.ts b/src/extension/telemetry/index.ts index 2aeaa406..5be026fe 100644 --- a/src/extension/telemetry/index.ts +++ b/src/extension/telemetry/index.ts @@ -303,6 +303,7 @@ export interface IEventNamePropertyMapping { * - `launch`: Launch/start new code and debug it. * - `attach`: Attach to an exiting python process (remote debugging). * - `test`: Debugging python tests. + * - `noConfig`: No config debugging. * * @type {TriggerType} */ diff --git a/src/extension/types.ts b/src/extension/types.ts index 10e89edf..68a5f187 100644 --- a/src/extension/types.ts +++ b/src/extension/types.ts @@ -147,7 +147,7 @@ export interface DebugConfigurationArguments extends LaunchRequestArguments, Att export type ConsoleType = 'internalConsole' | 'integratedTerminal' | 'externalTerminal'; -export type TriggerType = 'launch' | 'attach' | 'test'; +export type TriggerType = 'launch' | 'attach' | 'test' | 'noConfig'; export type IStartupDurations = Record< 'totalNonBlockingActivateTime' | 'totalActivateTime' | 'startActivateTime' | 'codeLoadingTime',