From d6b936c8713c49fa1d69948267bd41c8d9fba8ff Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Mon, 24 Feb 2025 09:12:46 -0800 Subject: [PATCH 1/2] remove stale debugging telemetry --- .../application/debugSessionTelemetry.ts | 80 ----- src/client/common/serviceRegistry.ts | 5 - .../debugger/extension/adapter/factory.ts | 7 - .../configuration/resolvers/attach.ts | 1 - .../extension/configuration/resolvers/base.ts | 33 -- .../configuration/resolvers/launch.ts | 7 +- .../debugger/extension/debugCommands.ts | 1 - .../hooks/childProcessAttachService.ts | 5 +- src/client/telemetry/constants.ts | 9 - src/client/telemetry/index.ts | 322 ------------------ src/client/telemetry/types.ts | 1 - src/test/common/moduleInstaller.test.ts | 5 - .../extension/adapter/factory.unit.test.ts | 5 - 13 files changed, 2 insertions(+), 479 deletions(-) delete mode 100644 src/client/common/application/debugSessionTelemetry.ts diff --git a/src/client/common/application/debugSessionTelemetry.ts b/src/client/common/application/debugSessionTelemetry.ts deleted file mode 100644 index 42b8b2651092..000000000000 --- a/src/client/common/application/debugSessionTelemetry.ts +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -'use strict'; -import { inject, injectable } from 'inversify'; -import { DebugAdapterTracker, DebugAdapterTrackerFactory, DebugSession, ProviderResult } from 'vscode'; -import { DebugProtocol } from 'vscode-debugprotocol'; - -import { IExtensionSingleActivationService } from '../../activation/types'; -import { AttachRequestArguments, ConsoleType, LaunchRequestArguments, TriggerType } from '../../debugger/types'; -import { sendTelemetryEvent } from '../../telemetry'; -import { EventName } from '../../telemetry/constants'; -import { IDisposableRegistry } from '../types'; -import { StopWatch } from '../utils/stopWatch'; -import { IDebugService } from './types'; - -function isResponse(a: any): a is DebugProtocol.Response { - return a.type === 'response'; -} -class TelemetryTracker implements DebugAdapterTracker { - private timer = new StopWatch(); - private readonly trigger: TriggerType = 'launch'; - private readonly console: ConsoleType | undefined; - - constructor(session: DebugSession) { - this.trigger = session.configuration.request as TriggerType; - const debugConfiguration = session.configuration as Partial; - this.console = debugConfiguration.console; - } - - public onWillStartSession() { - this.sendTelemetry(EventName.DEBUG_SESSION_START); - } - - public onDidSendMessage(message: any): void { - if (isResponse(message)) { - if (message.command === 'configurationDone') { - // "configurationDone" response is sent immediately after user code starts running. - this.sendTelemetry(EventName.DEBUG_SESSION_USER_CODE_RUNNING); - } - } - } - - public onWillStopSession(): void { - this.sendTelemetry(EventName.DEBUG_SESSION_STOP); - } - - public onError?(_error: Error): void { - this.sendTelemetry(EventName.DEBUG_SESSION_ERROR); - } - - private sendTelemetry(eventName: EventName): void { - if (eventName === EventName.DEBUG_SESSION_START) { - this.timer.reset(); - } - const telemetryProps = { - trigger: this.trigger, - console: this.console, - }; - sendTelemetryEvent(eventName, this.timer.elapsedTime, telemetryProps); - } -} - -@injectable() -export class DebugSessionTelemetry implements DebugAdapterTrackerFactory, IExtensionSingleActivationService { - public readonly supportedWorkspaceTypes = { untrustedWorkspace: false, virtualWorkspace: true }; - constructor( - @inject(IDisposableRegistry) disposableRegistry: IDisposableRegistry, - @inject(IDebugService) debugService: IDebugService, - ) { - disposableRegistry.push(debugService.registerDebugAdapterTrackerFactory('python', this)); - } - - public async activate(): Promise { - // We actually register in the constructor. Not necessary to do it here - } - - public createDebugAdapterTracker(session: DebugSession): ProviderResult { - return new TelemetryTracker(session); - } -} diff --git a/src/client/common/serviceRegistry.ts b/src/client/common/serviceRegistry.ts index 5b9eb544f93b..abd2b220e400 100644 --- a/src/client/common/serviceRegistry.ts +++ b/src/client/common/serviceRegistry.ts @@ -28,7 +28,6 @@ import { CommandManager } from './application/commandManager'; import { ReloadVSCodeCommandHandler } from './application/commands/reloadCommand'; import { ReportIssueCommandHandler } from './application/commands/reportIssueCommand'; import { DebugService } from './application/debugService'; -import { DebugSessionTelemetry } from './application/debugSessionTelemetry'; import { DocumentManager } from './application/documentManager'; import { Extensions } from './application/extensions'; import { LanguageService } from './application/languageService'; @@ -189,8 +188,4 @@ export function registerTypes(serviceManager: IServiceManager): void { IExtensionSingleActivationService, ReportIssueCommandHandler, ); - serviceManager.addSingleton( - IExtensionSingleActivationService, - DebugSessionTelemetry, - ); } diff --git a/src/client/debugger/extension/adapter/factory.ts b/src/client/debugger/extension/adapter/factory.ts index 546414699971..edef16368dc0 100644 --- a/src/client/debugger/extension/adapter/factory.ts +++ b/src/client/debugger/extension/adapter/factory.ts @@ -17,8 +17,6 @@ import { EXTENSION_ROOT_DIR } from '../../../constants'; import { IInterpreterService } from '../../../interpreter/contracts'; import { traceError, traceLog, traceVerbose } from '../../../logging'; import { PythonEnvironment } from '../../../pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../../telemetry'; -import { EventName } from '../../../telemetry/constants'; import { AttachRequestArguments, LaunchRequestArguments } from '../../types'; import { IDebugAdapterDescriptorFactory } from '../types'; import { showErrorMessage } from '../../../common/vscodeApis/windowApis'; @@ -76,10 +74,6 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac const command = await this.getDebugAdapterPython(configuration, session.workspaceFolder); if (command.length !== 0) { - if (configuration.request === 'attach' && configuration.processId !== undefined) { - sendTelemetryEvent(EventName.DEBUGGER_ATTACH_TO_LOCAL_PROCESS); - } - const executable = command.shift() ?? 'python'; // "logToFile" is not handled directly by the adapter - instead, we need to pass @@ -100,7 +94,6 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac const args = command.concat([debuggerAdapterPathToUse, ...logArgs]); traceLog(`DAP Server launched with command: ${executable} ${args.join(' ')}`); - sendTelemetryEvent(EventName.DEBUG_ADAPTER_USING_WHEELS_PATH, undefined, { usingWheels: true }); return new DebugAdapterExecutable(executable, args); } diff --git a/src/client/debugger/extension/configuration/resolvers/attach.ts b/src/client/debugger/extension/configuration/resolvers/attach.ts index 6e5ca501463e..1c232f261d03 100644 --- a/src/client/debugger/extension/configuration/resolvers/attach.ts +++ b/src/client/debugger/extension/configuration/resolvers/attach.ts @@ -87,7 +87,6 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver ): boolean { return !!(debugConfiguration.module && debugConfiguration.module.toUpperCase() === 'FLASK'); } - - protected static sendTelemetry( - trigger: 'launch' | 'attach' | 'test', - debugConfiguration: Partial, - ): void { - const name = debugConfiguration.name || ''; - const moduleName = debugConfiguration.module || ''; - const telemetryProps: DebuggerTelemetry = { - trigger, - console: debugConfiguration.console, - hasEnvVars: typeof debugConfiguration.env === 'object' && Object.keys(debugConfiguration.env).length > 0, - django: !!debugConfiguration.django, - fastapi: BaseConfigurationResolver.isDebuggingFastAPI(debugConfiguration), - flask: BaseConfigurationResolver.isDebuggingFlask(debugConfiguration), - hasArgs: Array.isArray(debugConfiguration.args) && debugConfiguration.args.length > 0, - isLocalhost: BaseConfigurationResolver.isLocalHost(debugConfiguration.host), - isModule: moduleName.length > 0, - isSudo: !!debugConfiguration.sudo, - jinja: !!debugConfiguration.jinja, - pyramid: !!debugConfiguration.pyramid, - stopOnEntry: !!debugConfiguration.stopOnEntry, - showReturnValue: !!debugConfiguration.showReturnValue, - subProcess: !!debugConfiguration.subProcess, - watson: name.toLowerCase().indexOf('watson') >= 0, - pyspark: name.toLowerCase().indexOf('pyspark') >= 0, - gevent: name.toLowerCase().indexOf('gevent') >= 0, - scrapy: moduleName.toLowerCase() === 'scrapy', - }; - sendTelemetryEvent(EventName.DEBUGGER, undefined, telemetryProps); - } } diff --git a/src/client/debugger/extension/configuration/resolvers/launch.ts b/src/client/debugger/extension/configuration/resolvers/launch.ts index d9bedaa5e4d5..3ca38fb0f710 100644 --- a/src/client/debugger/extension/configuration/resolvers/launch.ts +++ b/src/client/debugger/extension/configuration/resolvers/launch.ts @@ -13,7 +13,7 @@ import { EnvironmentVariables } from '../../../../common/variables/types'; import { IEnvironmentActivationService } from '../../../../interpreter/activation/types'; import { IInterpreterService } from '../../../../interpreter/contracts'; import { DebuggerTypeName } from '../../../constants'; -import { DebugOptions, DebugPurpose, LaunchRequestArguments } from '../../../types'; +import { DebugOptions, LaunchRequestArguments } from '../../../types'; import { BaseConfigurationResolver } from './base'; import { getProgram, IDebugEnvironmentVariablesService } from './helper'; import { @@ -194,11 +194,6 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver 0 ? pathMappings : undefined; } - const trigger = - debugConfiguration.purpose?.includes(DebugPurpose.DebugTest) || debugConfiguration.request === 'test' - ? 'test' - : 'launch'; - LaunchConfigurationResolver.sendTelemetry(trigger, debugConfiguration); } protected async validateLaunchConfiguration( diff --git a/src/client/debugger/extension/debugCommands.ts b/src/client/debugger/extension/debugCommands.ts index b3322e8e7dd1..629f8616a6d6 100644 --- a/src/client/debugger/extension/debugCommands.ts +++ b/src/client/debugger/extension/debugCommands.ts @@ -33,7 +33,6 @@ export class DebugCommands implements IExtensionSingleActivationService { public activate(): Promise { this.disposables.push( this.commandManager.registerCommand(Commands.Debug_In_Terminal, async (file?: Uri) => { - sendTelemetryEvent(EventName.DEBUG_IN_TERMINAL_BUTTON); const interpreter = await this.interpreterService.getActiveInterpreter(file); if (!interpreter) { this.commandManager.executeCommand(Commands.TriggerEnvironmentSelection, file).then(noop, noop); diff --git a/src/client/debugger/extension/hooks/childProcessAttachService.ts b/src/client/debugger/extension/hooks/childProcessAttachService.ts index 24eaf1b52769..ccc564198da8 100644 --- a/src/client/debugger/extension/hooks/childProcessAttachService.ts +++ b/src/client/debugger/extension/hooks/childProcessAttachService.ts @@ -6,9 +6,7 @@ import { inject, injectable } from 'inversify'; import { IDebugService } from '../../../common/application/types'; import { DebugConfiguration, DebugSession, l10n, WorkspaceFolder, DebugSessionOptions } from 'vscode'; -import { noop } from '../../../common/utils/misc'; -import { captureTelemetry } from '../../../telemetry'; -import { EventName } from '../../../telemetry/constants'; +import { noop } from '../../../common/utils/misc'; import { AttachRequestArguments } from '../../types'; import { IChildProcessAttachService } from './types'; import { showErrorMessage } from '../../../common/vscodeApis/windowApis'; @@ -22,7 +20,6 @@ import { getWorkspaceFolders } from '../../../common/vscodeApis/workspaceApis'; export class ChildProcessAttachService implements IChildProcessAttachService { constructor(@inject(IDebugService) private readonly debugService: IDebugService) {} - @captureTelemetry(EventName.DEBUGGER_ATTACH_TO_CHILD_PROCESS) public async attach(data: AttachRequestArguments & DebugConfiguration, parentSession: DebugSession): Promise { const debugConfig: AttachRequestArguments & DebugConfiguration = data; const folder = this.getRelatedWorkspaceFolder(debugConfig); diff --git a/src/client/telemetry/constants.ts b/src/client/telemetry/constants.ts index 53420c275e8a..5b0522a1a9ed 100644 --- a/src/client/telemetry/constants.ts +++ b/src/client/telemetry/constants.ts @@ -39,15 +39,6 @@ export enum EventName { EXECUTION_CODE = 'EXECUTION_CODE', EXECUTION_DJANGO = 'EXECUTION_DJANGO', - DEBUG_IN_TERMINAL_BUTTON = 'DEBUG.IN_TERMINAL', - DEBUG_ADAPTER_USING_WHEELS_PATH = 'DEBUG_ADAPTER.USING_WHEELS_PATH', - DEBUG_SESSION_ERROR = 'DEBUG_SESSION.ERROR', - DEBUG_SESSION_START = 'DEBUG_SESSION.START', - DEBUG_SESSION_STOP = 'DEBUG_SESSION.STOP', - DEBUG_SESSION_USER_CODE_RUNNING = 'DEBUG_SESSION.USER_CODE_RUNNING', - DEBUGGER = 'DEBUGGER', - DEBUGGER_ATTACH_TO_CHILD_PROCESS = 'DEBUGGER.ATTACH_TO_CHILD_PROCESS', - DEBUGGER_ATTACH_TO_LOCAL_PROCESS = 'DEBUGGER.ATTACH_TO_LOCAL_PROCESS', // Python testing specific telemetry UNITTEST_CONFIGURING = 'UNITTEST.CONFIGURING', diff --git a/src/client/telemetry/index.ts b/src/client/telemetry/index.ts index 37ae9328c546..284dbcb73031 100644 --- a/src/client/telemetry/index.ts +++ b/src/client/telemetry/index.ts @@ -9,7 +9,6 @@ import { AppinsightsKey, isTestExecution, isUnitTestExecution, PVSC_EXTENSION_ID import type { TerminalShellType } from '../common/terminal/types'; import { isPromise } from '../common/utils/async'; import { StopWatch } from '../common/utils/stopWatch'; -import { ConsoleType, TriggerType } from '../debugger/types'; import { EnvironmentType, PythonEnvironment } from '../pythonEnvironments/info'; import { TensorBoardPromptSelection } from '../tensorBoard/constants'; import { EventName } from './constants'; @@ -300,327 +299,6 @@ type FailedEventType = { failed: true }; // Map all events to their properties export interface IEventNamePropertyMapping { - /** - * Telemetry event sent when debug in terminal button was used to debug current file. - */ - /* __GDPR__ - "debug_in_terminal_button" : { "owner": "paulacamargo25" } - */ - [EventName.DEBUG_IN_TERMINAL_BUTTON]: never | undefined; - /** - * Telemetry event captured when debug adapter executable is created - */ - /* __GDPR__ - "debug_adapter.using_wheels_path" : { - "usingwheels" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" } - } - */ - - [EventName.DEBUG_ADAPTER_USING_WHEELS_PATH]: { - /** - * Carries boolean - * - `true` if path used for the adapter is the debugger with wheels. - * - `false` if path used for the adapter is the source only version of the debugger. - */ - usingWheels: boolean; - }; - /** - * Telemetry captured before starting debug session. - */ - /* __GDPR__ - "debug_session.start" : { - "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "trigger" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" }, - "console" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" } - } - */ - [EventName.DEBUG_SESSION_START]: { - /** - * Trigger for starting the debugger. - * - `launch`: Launch/start new code and debug it. - * - `attach`: Attach to an exiting python process (remote debugging). - * - `test`: Debugging python tests. - * - * @type {TriggerType} - */ - trigger: TriggerType; - /** - * Type of console used. - * -`internalConsole`: Use VS Code debug console (no shells/terminals). - * - `integratedTerminal`: Use VS Code terminal. - * - `externalTerminal`: Use an External terminal. - * - * @type {ConsoleType} - */ - console?: ConsoleType; - }; - /** - * Telemetry captured when debug session runs into an error. - */ - /* __GDPR__ - "debug_session.error" : { - "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "trigger" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" }, - "console" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" } - } - */ - [EventName.DEBUG_SESSION_ERROR]: { - /** - * Trigger for starting the debugger. - * - `launch`: Launch/start new code and debug it. - * - `attach`: Attach to an exiting python process (remote debugging). - * - `test`: Debugging python tests. - * - * @type {TriggerType} - */ - trigger: TriggerType; - /** - * Type of console used. - * -`internalConsole`: Use VS Code debug console (no shells/terminals). - * - `integratedTerminal`: Use VS Code terminal. - * - `externalTerminal`: Use an External terminal. - * - * @type {ConsoleType} - */ - console?: ConsoleType; - }; - /** - * Telemetry captured after stopping debug session. - */ - /* __GDPR__ - "debug_session.stop" : { - "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "trigger" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" }, - "console" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" } - } - */ - [EventName.DEBUG_SESSION_STOP]: { - /** - * Trigger for starting the debugger. - * - `launch`: Launch/start new code and debug it. - * - `attach`: Attach to an exiting python process (remote debugging). - * - `test`: Debugging python tests. - * - * @type {TriggerType} - */ - trigger: TriggerType; - /** - * Type of console used. - * -`internalConsole`: Use VS Code debug console (no shells/terminals). - * - `integratedTerminal`: Use VS Code terminal. - * - `externalTerminal`: Use an External terminal. - * - * @type {ConsoleType} - */ - console?: ConsoleType; - }; - /** - * Telemetry captured when user code starts running after loading the debugger. - */ - /* __GDPR__ - "debug_session.user_code_running" : { - "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "trigger" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" }, - "console" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "paulacamargo25" } - } - */ - [EventName.DEBUG_SESSION_USER_CODE_RUNNING]: { - /** - * Trigger for starting the debugger. - * - `launch`: Launch/start new code and debug it. - * - `attach`: Attach to an exiting python process (remote debugging). - * - `test`: Debugging python tests. - * - * @type {TriggerType} - */ - trigger: TriggerType; - /** - * Type of console used. - * -`internalConsole`: Use VS Code debug console (no shells/terminals). - * - `integratedTerminal`: Use VS Code terminal. - * - `externalTerminal`: Use an External terminal. - * - * @type {ConsoleType} - */ - console?: ConsoleType; - }; - /** - * Telemetry captured when starting the debugger. - */ - /* __GDPR__ - "debugger" : { - "trigger" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "console" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "hasenvvars": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "hasargs": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "django": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "fastapi": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "flask": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "jinja": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "islocalhost": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "ismodule": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "issudo": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "stoponentry": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "showreturnvalue": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "pyramid": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "subprocess": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "watson": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "pyspark": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "gevent": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" }, - "scrapy": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "paulacamargo25" } - } - */ - [EventName.DEBUGGER]: { - /** - * Trigger for starting the debugger. - * - `launch`: Launch/start new code and debug it. - * - `attach`: Attach to an exiting python process (remote debugging). - * - `test`: Debugging python tests. - * - * @type {TriggerType} - */ - trigger: TriggerType; - /** - * Type of console used. - * -`internalConsole`: Use VS Code debug console (no shells/terminals). - * - `integratedTerminal`: Use VS Code terminal. - * - `externalTerminal`: Use an External terminal. - * - * @type {ConsoleType} - */ - console?: ConsoleType; - /** - * Whether user has defined environment variables. - * Could have been defined in launch.json or the env file (defined in `settings.json`). - * Default `env file` is `.env` in the workspace folder. - * - * @type {boolean} - */ - hasEnvVars: boolean; - /** - * Whether there are any CLI arguments that need to be passed into the program being debugged. - * - * @type {boolean} - */ - hasArgs: boolean; - /** - * Whether the user is debugging `django`. - * - * @type {boolean} - */ - django: boolean; - /** - * Whether the user is debugging `fastapi`. - * - * @type {boolean} - */ - fastapi: boolean; - /** - * Whether the user is debugging `flask`. - * - * @type {boolean} - */ - flask: boolean; - /** - * Whether the user is debugging `jinja` templates. - * - * @type {boolean} - */ - jinja: boolean; - /** - * Whether user is attaching to a local python program (attach scenario). - * - * @type {boolean} - */ - isLocalhost: boolean; - /** - * Whether debugging a module. - * - * @type {boolean} - */ - isModule: boolean; - /** - * Whether debugging with `sudo`. - * - * @type {boolean} - */ - isSudo: boolean; - /** - * Whether required to stop upon entry. - * - * @type {boolean} - */ - stopOnEntry: boolean; - /** - * Whether required to display return types in debugger. - * - * @type {boolean} - */ - showReturnValue: boolean; - /** - * Whether debugging `pyramid`. - * - * @type {boolean} - */ - pyramid: boolean; - /** - * Whether debugging a subprocess. - * - * @type {boolean} - */ - subProcess: boolean; - /** - * Whether debugging `watson`. - * - * @type {boolean} - */ - watson: boolean; - /** - * Whether degbugging `pyspark`. - * - * @type {boolean} - */ - pyspark: boolean; - /** - * Whether using `gevent` when debugging. - * - * @type {boolean} - */ - gevent: boolean; - /** - * Whether debugging `scrapy`. - * - * @type {boolean} - */ - scrapy: boolean; - }; - /** - * Telemetry event sent when attaching to child process - */ - /* __GDPR__ - "debugger.attach_to_child_process" : { - "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "paulacamargo25" } - } - */ - [EventName.DEBUGGER_ATTACH_TO_CHILD_PROCESS]: never | undefined; - /** - * Telemetry event sent when attaching to a local process. - */ - /* __GDPR__ - "debugger.attach_to_local_process" : { "owner": "paulacamargo25" } - */ - [EventName.DEBUGGER_ATTACH_TO_LOCAL_PROCESS]: never | undefined; - /** - * Telemetry event sent with details of actions when invoking a diagnostic command - */ - /* __GDPR__ - "diagnostics.action" : { - "commandname" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" }, - "ignorecode" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" }, - "url" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" }, - "action" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "karthiknadig" } - } - */ [EventName.DIAGNOSTICS_ACTION]: { /** * Diagnostics command executed. diff --git a/src/client/telemetry/types.ts b/src/client/telemetry/types.ts index 865dca278bf0..42e51b261129 100644 --- a/src/client/telemetry/types.ts +++ b/src/client/telemetry/types.ts @@ -9,7 +9,6 @@ import { EventName } from './constants'; export type EditorLoadTelemetry = IEventNamePropertyMapping[EventName.EDITOR_LOAD]; export type PythonInterpreterTelemetry = IEventNamePropertyMapping[EventName.PYTHON_INTERPRETER]; -export type DebuggerTelemetry = IEventNamePropertyMapping[EventName.DEBUGGER]; export type TestTool = 'pytest' | 'unittest'; export type TestRunTelemetry = IEventNamePropertyMapping[EventName.UNITTEST_RUN]; export type TestDiscoveryTelemetry = IEventNamePropertyMapping[EventName.UNITTEST_DISCOVERY_DONE]; diff --git a/src/test/common/moduleInstaller.test.ts b/src/test/common/moduleInstaller.test.ts index 0b900b97c4c0..0cdb6f270c54 100644 --- a/src/test/common/moduleInstaller.test.ts +++ b/src/test/common/moduleInstaller.test.ts @@ -13,7 +13,6 @@ import { CommandManager } from '../../client/common/application/commandManager'; import { ReloadVSCodeCommandHandler } from '../../client/common/application/commands/reloadCommand'; import { ReportIssueCommandHandler } from '../../client/common/application/commands/reportIssueCommand'; import { DebugService } from '../../client/common/application/debugService'; -import { DebugSessionTelemetry } from '../../client/common/application/debugSessionTelemetry'; import { DocumentManager } from '../../client/common/application/documentManager'; import { Extensions } from '../../client/common/application/extensions'; import { @@ -259,10 +258,6 @@ suite('Module Installer', () => { IExtensionSingleActivationService, ReportIssueCommandHandler, ); - ioc.serviceManager.addSingleton( - IExtensionSingleActivationService, - DebugSessionTelemetry, - ); } test('Ensure pip is supported and conda is not', async () => { ioc.serviceManager.addSingletonInstance( diff --git a/src/test/debugger/extension/adapter/factory.unit.test.ts b/src/test/debugger/extension/adapter/factory.unit.test.ts index fde87d930078..50984327e40d 100644 --- a/src/test/debugger/extension/adapter/factory.unit.test.ts +++ b/src/test/debugger/extension/adapter/factory.unit.test.ts @@ -23,7 +23,6 @@ import { IInterpreterService } from '../../../../client/interpreter/contracts'; import { InterpreterService } from '../../../../client/interpreter/interpreterService'; import { EnvironmentType } from '../../../../client/pythonEnvironments/info'; import { clearTelemetryReporter } from '../../../../client/telemetry'; -import { EventName } from '../../../../client/telemetry/constants'; import * as windowApis from '../../../../client/common/vscodeApis/windowApis'; import { PersistentState, PersistentStateFactory } from '../../../../client/common/persistentState'; import { ICommandManager } from '../../../../client/common/application/types'; @@ -269,16 +268,12 @@ suite('Debugging - Adapter Factory', () => { test('Send attach to local process telemetry if attaching to a local process', async () => { const session = createSession({ request: 'attach', processId: 1234 }); await factory.createDebugAdapterDescriptor(session, nodeExecutable); - - assert.ok(Reporter.eventNames.includes(EventName.DEBUGGER_ATTACH_TO_LOCAL_PROCESS)); }); test("Don't send any telemetry if not attaching to a local process", async () => { const session = createSession({}); await factory.createDebugAdapterDescriptor(session, nodeExecutable); - - assert.ok(Reporter.eventNames.includes(EventName.DEBUG_ADAPTER_USING_WHEELS_PATH)); }); test('Use "debugAdapterPath" when specified', async () => { From acd87843dcfe0d9df7c89fe13bc091c50f1902f7 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Mon, 24 Feb 2025 09:22:26 -0800 Subject: [PATCH 2/2] linting --- .../debugger/extension/hooks/childProcessAttachService.ts | 2 +- src/client/telemetry/constants.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/debugger/extension/hooks/childProcessAttachService.ts b/src/client/debugger/extension/hooks/childProcessAttachService.ts index ccc564198da8..39556f94c87c 100644 --- a/src/client/debugger/extension/hooks/childProcessAttachService.ts +++ b/src/client/debugger/extension/hooks/childProcessAttachService.ts @@ -6,7 +6,7 @@ import { inject, injectable } from 'inversify'; import { IDebugService } from '../../../common/application/types'; import { DebugConfiguration, DebugSession, l10n, WorkspaceFolder, DebugSessionOptions } from 'vscode'; -import { noop } from '../../../common/utils/misc'; +import { noop } from '../../../common/utils/misc'; import { AttachRequestArguments } from '../../types'; import { IChildProcessAttachService } from './types'; import { showErrorMessage } from '../../../common/vscodeApis/windowApis'; diff --git a/src/client/telemetry/constants.ts b/src/client/telemetry/constants.ts index 5b0522a1a9ed..b98b31bad01a 100644 --- a/src/client/telemetry/constants.ts +++ b/src/client/telemetry/constants.ts @@ -39,7 +39,6 @@ export enum EventName { EXECUTION_CODE = 'EXECUTION_CODE', EXECUTION_DJANGO = 'EXECUTION_DJANGO', - // Python testing specific telemetry UNITTEST_CONFIGURING = 'UNITTEST.CONFIGURING', UNITTEST_CONFIGURE = 'UNITTEST.CONFIGURE',