From bcd44ef2e6efe1ef0d419306cb85950b3327e570 Mon Sep 17 00:00:00 2001 From: rebornix Date: Mon, 13 Jun 2022 15:04:17 -0700 Subject: [PATCH] Move kernel telemetry into kernel folder --- TELEMETRY.md | 9495 ----------------- src/interactive-window/interactiveWindow.ts | 2 +- src/kernels/execution/kernelExecution.ts | 3 +- src/kernels/helpers.node.ts | 2 +- .../launcher/liveshare/hostJupyterServer.ts | 2 +- .../jupyter/launcher/notebookProvider.ts | 3 +- src/kernels/kernel.base.ts | 4 +- src/kernels/kernelCrashMonitor.ts | 2 +- .../raw/launcher/kernelLauncher.node.ts | 2 +- .../session/hostRawNotebookProvider.node.ts | 2 +- .../raw/session/rawJupyterSession.node.ts | 3 +- src/kernels/telemetry/helper.ts | 163 + .../telemetry/sendKernelTelemetryEvent.ts | 148 + src/notebooks/controllers/kernelConnector.ts | 2 +- .../controllers/notebookControllerManager.ts | 2 +- .../controllers/vscodeNotebookController.ts | 6 +- src/notebooks/notebookCommandListener.ts | 2 +- .../telemetry/interpreterPackageTracker.ts | 2 +- src/notebooks/telemetry/kernelTelemetry.ts | 3 +- src/platform/startupTelemetry.ts | 3 +- src/telemetry/telemetry.ts | 303 +- 21 files changed, 340 insertions(+), 9814 deletions(-) create mode 100644 src/kernels/telemetry/helper.ts create mode 100644 src/kernels/telemetry/sendKernelTelemetryEvent.ts diff --git a/TELEMETRY.md b/TELEMETRY.md index 4205d2e7f59..a32e6eb1106 100644 --- a/TELEMETRY.md +++ b/TELEMETRY.md @@ -2,9498 +2,3 @@ Expand each section to see more information about that event. -
- DATASCIENCE.ADD_CELL_BELOW - -## Description - - - - Data Science - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.AddCellBelow) - private async addCellBelow(): Promise { - await this.getCurrentCodeWatcher()?.addEmptyCellToBottom(); - } -``` - -
-
- DATASCIENCE.CLICKED_EXPORT_NOTEBOOK_AS_QUICK_PICK - -## Description - - -No description provided - -## Properties - -- format: ExportFormat - -## Locations Used - -[src/interactive-window/commands/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts) -```typescript - if (pickedItem !== undefined) { - pickedItem.handler(); - } else { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick); - } - } - } -``` - - -[src/interactive-window/commands/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts) -```typescript - label: DataScience.exportPythonQuickPickLabel(), - picked: true, - handler: () => { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { - format: ExportFormat.python - }); - this.commandManager -``` - - -[src/interactive-window/commands/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts) -```typescript - label: DataScience.exportHTMLQuickPickLabel(), - picked: false, - handler: () => { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { - format: ExportFormat.html - }); - this.commandManager -``` - - -[src/interactive-window/commands/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts) -```typescript - label: DataScience.exportPDFQuickPickLabel(), - picked: false, - handler: () => { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { - format: ExportFormat.pdf - }); - this.commandManager -``` - -
-
- DATASCIENCE.COLLAPSE_ALL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.COPY_SOURCE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.CREATE_NEW_INTERACTIVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.CreateNewInteractive, undefined, false) - private async createNewInteractiveWindow(connection?: KernelConnectionMetadata): Promise { - await this.interactiveWindowProvider.getOrCreate(undefined, connection); - } -``` - -
-
- DATASCIENCE.DATA_VIEWER_DATA_DIMENSIONALITY - -## Description - - - - - Telemetry event sent when a slice is first applied in a - data viewer instance to a sliceable Python variable. - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) -```typescript - - private maybeSendSliceDataDimensionalityTelemetry(numberOfDimensions: number) { - if (!this.sentDataViewerSliceDimensionalityTelemetry) { - sendTelemetryEvent(Telemetry.DataViewerDataDimensionality, undefined, { numberOfDimensions }); - this.sentDataViewerSliceDimensionalityTelemetry = true; - } - } -``` - -
-
- DATASCIENCE.DATA_VIEWER_SLICE_ENABLEMENT_STATE_CHANGED - -## Description - - - - - Telemetry event sent whenever the user toggles the checkbox - controlling whether a slice is currently being applied to an - n-dimensional variable. - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) -```typescript - break; - - case DataViewerMessages.SliceEnablementStateChanged: - void sendTelemetryEvent(Telemetry.DataViewerSliceEnablementStateChanged, undefined, { - newState: payload.newState ? CheckboxState.Checked : CheckboxState.Unchecked - }); - break; -``` - -
-
- DATASCIENCE.DATA_VIEWER_SLICE_OPERATION - -## Description - - - - - Telemetry event sent whenever the user applies a valid slice - to a sliceable Python variable in the data viewer. - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) -```typescript - if (payload.shape?.length) { - this.maybeSendSliceDataDimensionalityTelemetry(payload.shape.length); - } - sendTelemetryEvent(Telemetry.DataViewerSliceOperation, undefined, { source: request.source }); - return this.postMessage(DataViewerMessages.InitializeData, payload); - } - }); -``` - -
-
- DATASCIENCE.DEBUG_CONTINUE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.DebugContinue) - private async debugContinue(): Promise { - // Make sure that we are in debug mode - if (this.debugService?.activeDebugSession) { -``` - -
-
- DATASCIENCE.DEBUG_CURRENT_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - return this.codeLenses; - } - - @captureTelemetry(Telemetry.DebugCurrentCell) - public async debugCurrentCell() { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { - return; -``` - - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - return this.runMatchingCell(range, advance); - } - - @captureTelemetry(Telemetry.DebugCurrentCell) - public async debugCell(range: Range): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { - return; -``` - -
-
- DATASCIENCE.DEBUG_FILE_INTERACTIVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - return this.runFileInteractiveInternal(false); - } - - @captureTelemetry(Telemetry.DebugFileInteractive) - public async debugFileInteractive() { - return this.runFileInteractiveInternal(true); - } -``` - -
-
- DATASCIENCE.DEBUG_STEP_OVER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.DebugStepOver) - private async debugStepOver(): Promise { - // Make sure that we are in debug mode - if (this.debugService?.activeDebugSession) { -``` - -
-
- DATASCIENCE.DEBUG_STOP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.DebugStop) - private async debugStop(uri: Uri): Promise { - // Make sure that we are in debug mode - if (this.debugService?.activeDebugSession && this.interactiveWindowProvider) { -``` - -
-
- DATASCIENCE.DEBUGGING.CLICKED_ON_SETUP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/debugger/debuggingManagerBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManagerBase.ts) -```typescript - ); - - if (response === DataScience.setup()) { - sendTelemetryEvent(DebuggingTelemetry.clickedOnSetup); - this.appShell.openUrl( - 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' - ); -``` - -
-
- DATASCIENCE.DEBUGGING.CLICKED_RUN_AND_DEBUG_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/debugger/debuggingManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManager.ts) -```typescript - }), - - this.commandManager.registerCommand(DSCommands.RunAndDebugCell, async (cell: NotebookCell | undefined) => { - sendTelemetryEvent(DebuggingTelemetry.clickedRunAndDebugCell); - const editor = this.vscNotebook.activeNotebookEditor; - if (!cell) { - const range = editor?.selections[0]; -``` - -
-
- DATASCIENCE.DEBUGGING.CLICKED_RUNBYLINE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/debugger/debuggingManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManager.ts) -```typescript - }), - - this.commandManager.registerCommand(DSCommands.RunByLine, async (cell: NotebookCell | undefined) => { - sendTelemetryEvent(DebuggingTelemetry.clickedRunByLine); - const editor = this.vscNotebook.activeNotebookEditor; - if (!cell) { - const range = editor?.selections[0]; -``` - -
-
- DATASCIENCE.DEBUGGING.CLOSED_MODAL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/debugger/debuggingManagerBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManagerBase.ts) -```typescript - 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' - ); - } else { - sendTelemetryEvent(DebuggingTelemetry.closedModal); - } - } -} -``` - -
-
- DATASCIENCE.DEBUGGING.ENDED_SESSION - -## Description - - -No description provided - -## Properties - -- - reason: 'normally' | 'onKernelDisposed' | 'onAnInterrupt' | 'onARestart' | 'withKeybinding'; - -## Locations Used - -[src/kernels/debugger/kernelDebugAdapterBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugger/kernelDebugAdapterBase.ts) -```typescript - this.kernel.onDisposed(() => { - debug.stopDebugging(this.session).then(noop, noop); - this.endSession.fire(this.session); - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'onKernelDisposed' }); - }) - ); - } -``` - - -[src/kernels/debugger/kernelDebugAdapterBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugger/kernelDebugAdapterBase.ts) -```typescript - cellStateChange.state === NotebookCellExecutionState.Idle && - !this.disconnected - ) { - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'normally' }); - this.disconnect().ignoreErrors(); - } - }, -``` - - -[src/notebooks/debugger/debuggingManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManager.ts) -```typescript - if (editor) { - const controller = this.notebookToRunByLineController.get(editor.notebook); - if (controller) { - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { - reason: 'withKeybinding' - }); - controller.stop(); -``` - -
-
- DATASCIENCE.DEBUGGING.IPYKERNEL6_STATUS - -## Description - - -No description provided - -## Properties - -- - status: 'installed' | 'notInstalled'; - -## Locations Used - -[src/notebooks/debugger/debuggingManagerBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManagerBase.ts) -```typescript - } - - const result = await isUsingIpykernel6OrLater(kernel); - sendTelemetryEvent(DebuggingTelemetry.ipykernel6Status, undefined, { - status: result === IpykernelCheckResult.Ok ? 'installed' : 'notInstalled' - }); - return result; -``` - -
-
- DATASCIENCE.DEBUGGING.SUCCESSFULLY_STARTED_IW_JUPYTER - -## Description - - - - - Telemetry sent when we have managed to successfully start the Interactive Window debugger using the Jupyter protocol. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DEBUGGING.SUCCESSFULLY_STARTED_RUN_AND_DEBUG_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/debugger/debugCellControllers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debugCellControllers.ts) -```typescript - private readonly kernel: IKernel, - private readonly commandManager: ICommandManager - ) { - sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunAndDebugCell); - } - - public async willSendEvent(_msg: DebugProtocolMessage): Promise { -``` - - -[src/interactive-window/debugger/jupyter/debugCellControllers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/jupyter/debugCellControllers.ts) -```typescript - public readonly debugCell: NotebookCell, - private readonly kernel: IKernel - ) { - sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunAndDebugCell); - } - - public async willSendEvent(_msg: DebugProtocolMessage): Promise { -``` - -
-
- DATASCIENCE.DEBUGGING.SUCCESSFULLY_STARTED_RUNBYLINE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/debugger/runByLineController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/runByLineController.ts) -```typescript - private readonly kernel: IKernel, - private readonly settings: IConfigurationService - ) { - sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunByLine); - } - - public continue(): void { -``` - -
-
- DATASCIENCE.DEBUGPY_INSTALL_CANCELLED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DEBUGPY_INSTALL_FAILED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DEBUGPY_PROMPT_TO_INSTALL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DEBUGPY_SUCCESSFULLY_INSTALLED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DELETE_ALL_CELLS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DELETE_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.DISABLE_INTERACTIVE_SHIFT_ENTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/shiftEnterBanner.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/shiftEnterBanner.ts) -```typescript - ); - } - - @captureTelemetry(Telemetry.DisableInteractiveShiftEnter) - public async disableInteractiveShiftEnter(): Promise { - await this.configuration.updateSetting( - 'sendSelectionToInteractiveWindow', -``` - - -[src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) -```typescript - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.DisableInteractiveShiftEnter - ]); - }); -}); -``` - -
-
- DATASCIENCE.ENABLE_INTERACTIVE_SHIFT_ENTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/shiftEnterBanner.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/shiftEnterBanner.ts) -```typescript - await this.disableBanner(); - } - - @captureTelemetry(Telemetry.EnableInteractiveShiftEnter) - public async enableInteractiveShiftEnter(): Promise { - await this.configuration.updateSetting( - 'sendSelectionToInteractiveWindow', -``` - - -[src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) -```typescript - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.EnableInteractiveShiftEnter - ]); - }); - -``` - -
-
- DATASCIENCE.ENTER_JUPYTER_URI - -## Description - - - - - Captures the telemetry when the Uri is manually entered by the user as part of the workflow when selecting a Kernel. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - return multiStep.run(this.startSelectingURI.bind(this, allowLocal), {}); - } - - @captureTelemetry(Telemetry.EnterJupyterURI) - @traceDecoratorError('Failed to enter Jupyter Uri') - public async enterJupyterURI(): Promise { - let initialValue = defaultUri; -``` - -
-
- DATASCIENCE.EXECUTE_CELL - -## Description - - - - Applies to everything (interactive+Notebooks & local+remote) - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript - properties?: P[E] & { waitBeforeSending?: Promise }, - ex?: Error -) { - if (eventName === Telemetry.ExecuteCell) { - setSharedProperty('userExecutedCell', 'true'); - } - -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript - stopWatch?: StopWatch, - properties?: P[E] & { [waitBeforeSending]?: Promise } -) { - if (eventName === Telemetry.ExecuteCell) { - setSharedProperty('userExecutedCell', 'true'); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any -``` - - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - return; - } - initializeInteractiveOrNotebookTelemetryBasedOnUserAction(notebook.uri, this.connection); - sendKernelTelemetryEvent(notebook.uri, Telemetry.ExecuteCell); - // Notebook is trusted. Continue to execute cells - await Promise.all(cells.map((cell) => this.executeCell(notebook, cell))); - } -``` - - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - } - public async executeCell(cell: NotebookCell, codeOverride?: string): Promise { - traceCellMessage(cell, `kernel.executeCell, ${getDisplayPath(cell.notebook.uri)}`); - sendKernelTelemetryEvent(this.resourceUri, Telemetry.ExecuteCell); - const stopWatch = new StopWatch(); - const sessionPromise = this.startJupyterSession(); - const promise = this.kernelExecution.executeCell(sessionPromise, cell, codeOverride); -``` - - -[src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) -```typescript - }; - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.ExecuteCell); - assertEvent(Telemetry.OpenNotebookAll); - assertEvent(Telemetry.NotebookStart); - }); -``` - -
-
- DATASCIENCE.EXECUTE_CELL_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.EXPAND_ALL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.EXPORT_NOTEBOOK - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.EXPORT_NOTEBOOK_AS - -## Description - - -No description provided - -## Properties - -- format: ExportFormat; -- cancelled?: boolean; -- successful?: boolean; -- opened?: boolean - -## Locations Used - -[src/platform/export/exportFileOpener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/export/exportFileOpener.ts) -```typescript - public async openFile(format: ExportFormat, uri: Uri, openDirectly: boolean = false) { - if (format === ExportFormat.python) { - await this.openPythonFile(uri, openDirectly); - sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { - format: format, - successful: true, - opened: true -``` - - -[src/platform/export/exportFileOpener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/export/exportFileOpener.ts) -```typescript - }); - } else { - const opened = await this.askOpenFile(uri, openDirectly); - sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { - format: format, - successful: true, - opened: opened -``` - - -[src/platform/export/fileConverter.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/export/fileConverter.ts) -```typescript - } - - if (reporter.token.isCancellationRequested) { - sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { format: format, cancelled: true }); - return; - } - } -``` - -
-
- DATASCIENCE.EXPORT_NOTEBOOK_AS_COMMAND - -## Description - - -No description provided - -## Properties - -- format: ExportFormat - -## Locations Used - -[src/interactive-window/commands/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts) -```typescript - this.controllers.getSelectedNotebookController(sourceDocument)?.connection.interpreter || - this.controllers.getPreferredNotebookController(sourceDocument)?.connection.interpreter; - if (exportMethod) { - sendTelemetryEvent(Telemetry.ExportNotebookAsCommand, undefined, { format: exportMethod }); - } - } - -``` - -
-
- DATASCIENCE.EXPORT_NOTEBOOK_AS_FAILED - -## Description - - -No description provided - -## Properties - -- format: ExportFormat - -## Locations Used - -[src/platform/export/fileConverter.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/export/fileConverter.ts) -```typescript - await this.performExport(format, sourceDocument, target, token, candidateInterpreter); - } catch (e) { - traceError('Export failed', e); - sendTelemetryEvent(Telemetry.ExportNotebookAsFailed, undefined, { format: format }); - - if (format === ExportFormat.pdf) { - traceError(localize.DataScience.exportToPDFDependencyMessage()); -``` - -
-
- DATASCIENCE.EXPORT_PYTHON_FILE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) -```typescript - return result; - } - - @captureTelemetry(Telemetry.ExportPythonFileInteractive, undefined, false) - private async exportFile(file: Uri): Promise { - const filePath = getFilePath(file); - if (filePath && filePath.length > 0 && this.jupyterExporter) { -``` - -
-
- DATASCIENCE.EXPORT_PYTHON_FILE_AND_OUTPUT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.ExportPythonFileAndOutputInteractive, undefined, false) - private async exportFileAndOutput(file: Uri): Promise { - const filePath = getFilePath(file); - if ( -``` - -
-
- DATASCIENCE.FAILED_SHOW_DATA_EXPLORER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) -```typescript - } - } catch (e) { - traceError(e); - sendTelemetryEvent(Telemetry.FailedShowDataViewer); - this.appShell.showErrorMessage(localize.DataScience.showDataViewerFail()).then(noop, noop); - } - } -``` - -
-
- DATASCIENCE.FAILED_TO_CREATE_CONTROLLER - -## Description - - - - Telemetry sent when we fail to create a Notebook Controller (an entry for the UI kernel list in Native Notebooks). - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/notebookControllerManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts) -```typescript - } - // We know that this fails when we have xeus kernels installed (until that's resolved thats one instance when we can have duplicates). - sendTelemetryEvent( - Telemetry.FailedToCreateNotebookController, - undefined, - { kind: kernelConnection.kind }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any -``` - -
-
- DATASCIENCE.FAILED_TO_FIND_INTERPRETER_KERNEL_CONNECTION_FOR_INTERACTIVE - -## Description - - - - - Telemetry sent when we're unable to find a KernelSpec connection for Interactive window that can be started usig Python interpreter. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.FETCH_CONTROLLERS - -## Description - - - - - Telemetry sent when we have loaded some controllers. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/kernelFinder.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelFinder.base.ts) -```typescript - const key = `${kind}:${useCache}`; - if (this.startTimeForFetching && !this.fetchingTelemetrySent.has(key)) { - this.fetchingTelemetrySent.add(key); - sendTelemetryEvent(Telemetry.FetchControllers, this.startTimeForFetching.elapsedTime, { - cached: useCache === 'useCache', - kind - }); -``` - -
-
- DATASCIENCE.GET_PASSWORD_ATTEMPT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) -```typescript - this.serverUriStorage.onDidRemoveUris(this.onDidRemoveUris, this, this.disposables); - } - - @captureTelemetry(Telemetry.GetPasswordAttempt) - public getPasswordConnectionInfo(url: string): Promise { - if (!url || url.length < 1) { - return Promise.resolve(undefined); -``` - -
-
- DATASCIENCE.GOTO_NEXT_CELL_IN_FILE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - }); - } - - @captureTelemetry(Telemetry.GotoNextCellInFile) - public gotoNextCell() { - const editor = this.documentManager.activeTextEditor; - if (!editor || !editor.selection) { -``` - -
-
- DATASCIENCE.GOTO_PREV_CELL_IN_FILE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.GotoPrevCellInFile) - public gotoPreviousCell() { - const editor = this.documentManager.activeTextEditor; - if (!editor || !editor.selection) { -``` - -
-
- DATASCIENCE.GOTO_SOURCE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.IMPORT_NOTEBOOK - -## Description - - -No description provided - -## Properties - -- scope: 'command' | 'file' - -## Locations Used - -[src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) -```typescript - return this.statusProvider.waitWithStatus(promise, message, undefined, canceled); - } - - @captureTelemetry(Telemetry.ImportNotebook, { scope: 'command' }, false) - private async importNotebook(): Promise { - const filtersKey = localize.DataScience.importDialogFilter(); - const filtersObject: { [name: string]: string[] } = {}; -``` - - -[src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.ImportNotebook, { scope: 'file' }, false) - private async importNotebookOnFile(file: Uri): Promise { - const filepath = getFilePath(file); - if (filepath && filepath.length > 0) { -``` - -
-
- DATASCIENCE.INTERACTIVE_WINDOW_DEBUG_SETUP_CODE_FAILURE - -## Description - - -No description provided - -## Properties - -- - ename: string; -- - evalue: string; - -## Locations Used - -[src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) -```typescript - executeSilently(kernel.session, this.tracingEnableCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure enabling tracing code for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }).ignoreErrors(); - } - -``` - - -[src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) -```typescript - executeSilently(kernel.session, this.tracingDisableCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure disabling tracing code for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }).ignoreErrors(); - } - -``` - - -[src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) -```typescript - const importResults = await executeSilently(kernel.session, this.waitForDebugClientCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure starting debug session for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }); - if (importResults.some((item) => item.output_type === 'error')) { - traceWarning(`${this.debuggerPackage} not found in path.`); -``` - - -[src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) -```typescript - { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure appending debugger paths for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - } - ) - : []; -``` - - -[src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) -```typescript - ? await executeSilently(kernel.session, this.enableDebuggerCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure enabling debugging for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }) - : []; - -``` - -
-
- DATASCIENCE.INTERRUPT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) -```typescript - this.documentExecutions.set(document, newCellExecutionQueue); - return newCellExecutionQueue; - } - @captureTelemetry(Telemetry.Interrupt) - @captureTelemetry(Telemetry.InterruptJupyterTime) - private async interruptExecution( - session: IJupyterSession, -``` - -
-
- DATASCIENCE.JUPYTER_COMMAND_SEARCH - -## Description - - -No description provided - -## Properties - -- - where: 'activeInterpreter' | 'otherInterpreter' | 'path' | 'nowhere'; -- - command: JupyterCommands; - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.JUPYTER_KERNEL_API_ACCESS - -## Description - - -No description provided - -## Properties - -- - extensionId: string; -- - allowed: 'yes' | 'no'; - -## Locations Used - -[src/platform/api/apiAccessService.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/apiAccessService.ts) -```typescript - const extensionPermissions = this.globalState.get(API_ACCESS_GLOBAL_KEY); - const extensionPermission = extensionPermissions?.find((item) => item.extensionId === info.extensionId); - if (extensionPermission) { - sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { - extensionId: info.extensionId, - allowed: extensionPermission.allowed - }); -``` - - -[src/platform/api/apiAccessService.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/apiAccessService.ts) -```typescript - return this.globalState.update(API_ACCESS_GLOBAL_KEY, extensionPermissions); - }) - .then(noop, noop); - sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { - extensionId: info.extensionId, - allowed: allow ? 'yes' : 'no' - }); -``` - -
-
- DATASCIENCE.JUPYTER_KERNEL_API_USAGE - -## Description - - -No description provided - -## Properties - -- - extensionId: string; -- - pemUsed: keyof IExportedKernelService; - -## Locations Used - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - KernelConnectionMetadata - >(); - public get onDidChangeKernelSpecifications(): Event { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'onDidChangeKernelSpecifications' - }); -``` - - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - return this._onDidChangeKernelSpecifications.event; - } - public get onDidChangeKernels(): Event { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'onDidChangeKernels' - }); -``` - - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - ); - } - async getKernelSpecifications(refresh?: boolean): Promise { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'getKernelSpecifications' - }); -``` - - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - return items.map((item) => this.translateKernelConnectionMetadataToExportedType(item)); - } - getActiveKernels(): { metadata: KernelConnectionMetadata; uri: Uri | undefined }[] { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'getActiveKernels' - }); -``` - - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - return kernels; - } - getKernel(uri: Uri): { metadata: KernelConnectionMetadata; connection: IKernelConnectionInfo } | undefined { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'getKernel' - }); -``` - - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - } - } - async startKernel(spec: KernelConnectionMetadata, uri: Uri): Promise { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'startKernel' - }); -``` - - -[src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) -```typescript - return this.startOrConnect(spec, uri); - } - async connect(spec: ActiveKernel, uri: Uri): Promise { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'connect' - }); -``` - -
-
- DATASCIENCE.JUPYTER_KERNEL_FILTER_USED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/kernelFilter/kernelFilterUI.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/kernelFilter/kernelFilterUI.ts) -```typescript - .map((item) => item.connection) - .filter((item) => !selectedItems.has(item)); - this.kernelFilter.storeHiddenKernels(hiddenConnections.map((item) => item)).then(noop, noop); - sendTelemetryEvent(Telemetry.JupyterKernelFilterUsed); - }, - this, - disposables -``` - -
-
- DATASCIENCE.JUPYTER_KERNEL_HIDDEN_VIA_FILTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/kernelFilter/kernelFilterService.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/kernelFilter/kernelFilterService.ts) -```typescript - }); - - if (hidden) { - sendTelemetryEvent(Telemetry.JupyterKernelHiddenViaFilter); - } - return hidden; - } -``` - -
-
- DATASCIENCE.JUPYTER_NOT_INSTALLED_ERROR_SHOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - moduleName: ProductNames.get(Product.jupyter)!, - pythonEnvType: interpreter.envType - }); - sendTelemetryEvent(Telemetry.JupyterNotInstalledErrorShown); - const selection = await this.applicationShell.showErrorMessage( - message, - { modal: true }, -``` - -
-
- DATASCIENCE.KERNEL_CRASH - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/kernelCrashMonitor.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelCrashMonitor.ts) -```typescript - } - private async endCellAndDisplayErrorsInCell(kernel: IKernel) { - const lastExecutedCell = this.lastExecutedCellPerKernel.get(kernel); - sendKernelTelemetryEvent(kernel.resourceUri, Telemetry.KernelCrash); - if (!lastExecutedCell) { - return; - } -``` - -
-
- DATASCIENCE.KERNEL_SPEC_LANGUAGE - -## Description - - -No description provided - -## Properties - -- - /** - * Language of the kernelSpec. - */ - language: string; -- - /** - * Whether this is a local or remote kernel. - */ - kind: 'local' | 'remote'; -- - /** - * Whether shell is used to start the kernel. E.g. `"/bin/sh"` is used in the argv of the kernelSpec. - * OCaml is one such kernel. - */ - usesShell?: boolean; - -## Locations Used - -[src/kernels/raw/finder/helper.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/helper.ts) -```typescript - arg = arg.toLowerCase(); - return shellScripts.some((shell) => arg.includes(shell)); - }); - sendTelemetryEvent(Telemetry.KernelSpecLanguage, undefined, { - language: getTelemetrySafeLanguage(kernelSpec.language), - kind, - usesShell -``` - -
-
- DATASCIENCE.KERNEL_STARTUP_CODE_FAILURE - -## Description - - -No description provided - -## Properties - -- - ename: string; -- - evalue: string; - -## Locations Used - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - await this.executeSilently(session, startupCode, { - traceErrors: true, - traceErrorsMessage: 'Error executing jupyter extension internal startup code', - telemetryName: Telemetry.KernelStartupCodeFailure - }); - - // Run user specified startup commands -``` - -
-
- DATASCIENCE.NATIVE.CONVERT_NOTEBOOK_TO_PYTHON - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.CREATE_NEW_NOTEBOOK - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/notebookEditorProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookEditorProvider.ts) -```typescript -export class NotebookEditorProvider implements INotebookEditorProvider { - private providers: Set = new Set(); - constructor(@inject(IVSCodeNotebook) private readonly vscodeNotebook: IVSCodeNotebook) {} - @captureTelemetry(Telemetry.CreateNewNotebook, undefined, false) - public async createNew(options?: { contents?: string; defaultCellLanguage: string }): Promise { - // contents will be ignored - const language = options?.defaultCellLanguage ?? PYTHON_LANGUAGE; -``` - -
-
- DATASCIENCE.NATIVE.KEYBOARD.ARROW_DOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.ARROW_UP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.CHANGE_TO_CODE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.CHANGE_TO_MARKDOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.DELETE_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.INSERT_ABOVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.INSERT_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.REDO - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.RUN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.RUN_AND_ADD - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.RUN_AND_MOVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.SAVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.TOGGLE_LINE_NUMBERS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.TOGGLE_OUTPUT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.UNDO - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.KEYBOARD.UNFOCUS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.ADD_TO_END - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.CHANGE_TO_CODE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.CHANGE_TO_MARKDOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.DELETE_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.INSERT_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.MOVE_CELL_DOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.MOVE_CELL_UP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.RUN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.RUN_ABOVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.RUN_ALL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.RUN_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.SAVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.SELECT_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.SELECT_SERVER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.MOUSE.TOGGLE_VARIABLE_EXPLORER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.OPEN_NOTEBOOK - -## Description - - -No description provided - -## Properties - -- scope: 'command' | 'file' - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.OPEN_NOTEBOOK_ALL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/activation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/activation.node.ts) -```typescript - } - this.notebookOpened = true; - this.PreWarmDaemonPool().ignoreErrors(); - sendTelemetryEvent(Telemetry.OpenNotebookAll); - - if (!this.rawSupported.isSupported && this.extensionChecker.isPythonExtensionInstalled) { - // Warm up our selected interpreter for the extension -``` - - -[src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) -```typescript - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.ExecuteCell); - assertEvent(Telemetry.OpenNotebookAll); - assertEvent(Telemetry.NotebookStart); - }); - test('Run interactive window', async () => { -``` - -
-
- DATASCIENCE.NATIVE.OPEN_NOTEBOOK_SELECTION - -## Description - - - - - Telemetry sent with details of the selection of the quick pick for when user creates new notebook. - This only applies with other extensions like .NET registers with us. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NATIVE.OPEN_NOTEBOOK_SELECTION_REGISTERED - -## Description - - -No description provided - -## Properties - -- - /** - * The id of the extension registering with us to be displayed the dropdown list for notebook creation. - */ - extensionId: string; - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.NOTEBOOK_INTERRUPT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function resetData(resource: Resource, eventName: string, properties: any) { - // Once we have successfully interrupted, clear the interrupt counter. - if (eventName === Telemetry.NotebookInterrupt) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookInterrupt] = properties; - // Check result to determine if success. -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript -function resetData(resource: Resource, eventName: string, properties: any) { - // Once we have successfully interrupted, clear the interrupt counter. - if (eventName === Telemetry.NotebookInterrupt) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookInterrupt] = properties; - // Check result to determine if success. - if (data && 'result' in data && data.result === InterruptResult.Success) { -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript - // Once we have successfully interrupted, clear the interrupt counter. - if (eventName === Telemetry.NotebookInterrupt) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookInterrupt] = properties; - // Check result to determine if success. - if (data && 'result' in data && data.result === InterruptResult.Success) { - clearInterruptCounter(resource); -``` - - -[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) -```typescript - // Otherwise a real error occurred. - sendKernelTelemetryEvent( - this.kernel.resourceUri, - Telemetry.NotebookInterrupt, - stopWatch.elapsedTime, - undefined, - exc -``` - - -[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) -```typescript - })(); - - return promise.then((result) => { - sendKernelTelemetryEvent(this.kernel.resourceUri, Telemetry.NotebookInterrupt, stopWatch.elapsedTime, { - result - }); - return result; -``` - -
-
- DATASCIENCE.NOTEBOOK_LANGUAGE - -## Description - - - - - Telemetry event sent to indicate the language used in a notebook - - @type { language: string } - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/utils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/utils.ts) -```typescript -} - -export function sendNotebookOrKernelLanguageTelemetry( - telemetryEvent: Telemetry.SwitchToExistingKernel | Telemetry.NotebookLanguage, - language?: string -) { - language = getTelemetrySafeLanguage(language); -``` - -
-
- DATASCIENCE.NOTEBOOK_RESTART - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript - } - } - // Once we have successfully restarted, clear the interrupt counter. - if (eventName === Telemetry.NotebookRestart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookRestart] = properties; - // For restart to be successful, we should not have `failed` -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript - } - // Once we have successfully restarted, clear the interrupt counter. - if (eventName === Telemetry.NotebookRestart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookRestart] = properties; - // For restart to be successful, we should not have `failed` - const failed = data && 'failed' in data ? data.failed : false; -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript - // Once we have successfully restarted, clear the interrupt counter. - if (eventName === Telemetry.NotebookRestart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookRestart] = properties; - // For restart to be successful, we should not have `failed` - const failed = data && 'failed' in data ? data.failed : false; - if (!failed) { -``` - - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - await (this._jupyterSessionPromise - ? this.kernelExecution.restart(this._jupyterSessionPromise) - : this.start(new DisplayOptions(false))); - sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime); - } catch (ex) { - traceError(`Restart failed ${getDisplayPath(this.uri)}`, ex); - this._ignoreJupyterSessionDisposedErrors = true; -``` - - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - this.restarting = undefined; - // If we get a kernel promise failure, then restarting timed out. Just shutdown and restart the entire server. - // Note, this code might not be necessary, as such an error is thrown only when interrupting a kernel times out. - sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime, undefined, ex); - await session?.dispose().catch(noop); - this._ignoreJupyterSessionDisposedErrors = false; - throw ex; -``` - -
-
- DATASCIENCE.NOTEBOOK_START - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { - if (eventName === Telemetry.NotebookStart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookStart] = properties; - // Check start failed. -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { - if (eventName === Telemetry.NotebookStart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookStart] = properties; - // Check start failed. - if (data && 'failed' in data && data.failed) { -``` - - -[src/telemetry/telemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts) -```typescript -function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { - if (eventName === Telemetry.NotebookStart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookStart] = properties; - // Check start failed. - if (data && 'failed' in data && data.failed) { - trackKernelResourceInformation(resource, { startFailed: true }); -``` - - -[src/kernels/jupyter/launcher/notebookProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/notebookProvider.ts) -```typescript - - sendKernelTelemetryWhenDone( - options.resource, - Telemetry.NotebookStart, - promise || Promise.resolve(undefined), - undefined, - { -``` - - -[src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) -```typescript - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.ExecuteCell); - assertEvent(Telemetry.OpenNotebookAll); - assertEvent(Telemetry.NotebookStart); - }); - test('Run interactive window', async () => { - const { activeInteractiveWindow } = await runNewPythonFile( -``` - -
-
- DATASCIENCE.OPEN_PLOT_VIEWER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/plotting/plotViewerProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/plotting/plotViewerProvider.node.ts) -```typescript - this.currentViewer = this.serviceContainer.get(IPlotViewer); - this.currentViewerClosed = this.currentViewer.closed(this.closedViewer); - this.currentViewer.removed(this.removedPlot); - sendTelemetryEvent(Telemetry.OpenPlotViewer); - await this.currentViewer.show(); - } - -``` - -
-
- DATASCIENCE.OPENED_INTERACTIVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.PYTHON_VARIABLE_FETCHING_CODE_FAILURE - -## Description - - -No description provided - -## Properties - -- - ename: string; -- - evalue: string; - -## Locations Used - -[src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) -```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getDataFrameInfo', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); - -``` - - -[src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) -```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getDataFrameRows', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); - -``` - - -[src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) -```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getVariableProperties', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); - result = { ...result, ...this.deserializeJupyterResult(attributes) }; -``` - - -[src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) -```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getVariableNamesAndTypesFromKernel', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); - -``` - - -[src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) -```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getFullVariable', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); - -``` - -
-
- DATASCIENCE.RECOMMENT_EXTENSION - -## Description - - - - Telemetry sent when we recommend installing an extension. - -## Properties - -- - /** - * Extension we recommended the user to install. - */ - extensionId: string; -- - /** - * `displayed` - If prompt was displayed - * `dismissed` - If prompt was displayed & dismissed by the user - * `ok` - If prompt was displayed & ok clicked by the user - * `cancel` - If prompt was displayed & cancel clicked by the user - * `doNotShowAgain` - If prompt was displayed & doNotShowAgain clicked by the user - */ - action: 'displayed' | 'dismissed' | 'ok' | 'cancel' | 'doNotShowAgain'; - -## Locations Used - -[src/platform/common/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/extensionRecommendation.node.ts) -```typescript - `[${extensionInfo.displayName}](${extensionInfo.extensionLink})`, - language - ); - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'displayed' }); - const selection = await this.appShell.showInformationMessage( - message, - Common.bannerLabelYes(), -``` - - -[src/platform/common/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/extensionRecommendation.node.ts) -```typescript - ); - switch (selection) { - case Common.bannerLabelYes(): { - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'ok' }); - this.commandManager.executeCommand('extension.open', extensionId).then(noop, noop); - break; - } -``` - - -[src/platform/common/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/extensionRecommendation.node.ts) -```typescript - break; - } - case Common.bannerLabelNo(): { - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'cancel' }); - break; - } - case Common.doNotShowAgain(): { -``` - - -[src/platform/common/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/extensionRecommendation.node.ts) -```typescript - break; - } - case Common.doNotShowAgain(): { - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'doNotShowAgain' }); - const list = this.globalMemento.get(mementoKeyToNeverPromptExtensionAgain, []); - if (!list.includes(extensionId)) { - list.push(extensionId); -``` - - -[src/platform/common/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/extensionRecommendation.node.ts) -```typescript - break; - } - default: - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'dismissed' }); - } - } -} -``` - -
-
- DATASCIENCE.REDO - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.REFRESH_DATA_VIEWER - -## Description - - - - - Sent when the jupyter.refreshDataViewer command is invoked - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) -```typescript - - case DataViewerMessages.RefreshDataViewer: - this.refreshData().ignoreErrors(); - void sendTelemetryEvent(Telemetry.RefreshDataViewer); - break; - - case DataViewerMessages.SliceEnablementStateChanged: -``` - -
-
- DATASCIENCE.RESTART_KERNEL_COMMAND - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/notebookCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookCommandListener.ts) -```typescript - return; - } - - sendTelemetryEvent(Telemetry.RestartKernelCommand); - const kernel = this.kernelProvider.get(document.uri); - - if (kernel) { -``` - -
-
- DATASCIENCE.RUN_ADD_EMPTY_CELL_TO_BOTTOM - -## Description - - - - - Misc - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.RUN_ALL_CELLS - -## Description - - - - - Run Cell Commands in Interactive Python - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - this.closeDocumentDisposable?.dispose(); // NOSONAR - this.updateRequiredDisposable?.dispose(); // NOSONAR - } - @captureTelemetry(Telemetry.RunAllCells) - public async runAllCells() { - const iw = await this.getActiveInteractiveWindow(); - const runCellCommands = this.codeLenses.filter( -``` - -
-
- DATASCIENCE.RUN_ALL_CELLS_ABOVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - - // Run all cells up to the cell containing this start line and character - @captureTelemetry(Telemetry.RunAllCellsAbove) - public async runAllCellsAbove(stopLine: number, stopCharacter: number) { - const iw = await this.getActiveInteractiveWindow(); - const runCellCommands = this.codeLenses.filter((c) => c.command && c.command.command === Commands.RunCell); -``` - -
-
- DATASCIENCE.RUN_BY_LINE - -## Description - - - - Run by line events - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.RUN_BY_LINE_STEP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.RUN_BY_LINE_STOP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.RUN_BY_LINE_VARIABLE_HOVER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/variables/debuggerVariables.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/debuggerVariables.ts) -```typescript - // Note, full variable results isn't necessary for this call. It only really needs the variable value. - const result = this.lastKnownVariables.find((v) => v.name === name); - if (result && kernel?.resourceUri && uriPath.extname(kernel?.resourceUri).toLowerCase() === '.ipynb') { - sendTelemetryEvent(Telemetry.RunByLineVariableHover); - } - return result; - } -``` - -
-
- DATASCIENCE.RUN_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.RUN_CELL_AND_ALL_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - await finished; - } - - @captureTelemetry(Telemetry.RunCellAndAllBelow) - public async runCellAndAllBelow(startLine: number, startCharacter: number) { - const iw = await this.getActiveInteractiveWindow(); - const runCellCommands = this.codeLenses.filter((c) => c.command && c.command.command === Commands.RunCell); -``` - -
-
- DATASCIENCE.RUN_CHANGE_CELL_TO_CODE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - }); - } - - @captureTelemetry(Telemetry.ChangeCellToCode) - public changeCellToCode() { - this.applyToCells((editor, cell, _) => { - return this.changeCellTo(editor, cell, 'code'); -``` - -
-
- DATASCIENCE.RUN_CHANGE_CELL_TO_MARKDOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - await this.moveCellsDirection(false); - } - - @captureTelemetry(Telemetry.ChangeCellToMarkdown) - public changeCellToMarkdown() { - this.applyToCells((editor, cell, _) => { - return this.changeCellTo(editor, cell, 'markdown'); -``` - -
-
- DATASCIENCE.RUN_CURRENT_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - return this.runMatchingCell(range, false, true); - } - - @captureTelemetry(Telemetry.RunCurrentCell) - public async runCurrentCell(): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { - return; -``` - -
-
- DATASCIENCE.RUN_CURRENT_CELL_AND_ADD_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.RunCurrentCellAndAddBelow) - public async runCurrentCellAndAddBelow(): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { - return; -``` - -
-
- DATASCIENCE.RUN_CURRENT_CELL_AND_ADVANCE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - return this.runMatchingCell(this.documentManager.activeTextEditor.selection, false); - } - - @captureTelemetry(Telemetry.RunCurrentCellAndAdvance) - public async runCurrentCellAndAdvance() { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { - return; -``` - -
-
- DATASCIENCE.RUN_DELETE_CELLS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.DeleteCells) - public deleteCells() { - const editor = this.documentManager.activeTextEditor; - if (!editor || !editor.selection) { -``` - -
-
- DATASCIENCE.RUN_EXTEND_SELECTION_BY_CELL_ABOVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - editor.selections = selections; - } - - @captureTelemetry(Telemetry.ExtendSelectionByCellAbove) - public extendSelectionByCellAbove() { - // This behaves similarly to excel "Extend Selection by One Cell Above". - // The direction of the selection matters (i.e. where the active cursor) -``` - -
-
- DATASCIENCE.RUN_EXTEND_SELECTION_BY_CELL_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.ExtendSelectionByCellBelow) - public extendSelectionByCellBelow() { - // This behaves similarly to excel "Extend Selection by One Cell Above". - // The direction of the selection matters (i.e. where the active cursor) -``` - -
-
- DATASCIENCE.RUN_FILE_INTERACTIVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.RunFileInteractive) - public async runFileInteractive() { - return this.runFileInteractiveInternal(false); - } -``` - - -[src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) -```typescript - }; - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.RunFileInteractive); - assertEvent(Telemetry.ExecuteCellPerceivedWarm); - assertEvent(Telemetry.SwitchKernel); - }); -``` - -
-
- DATASCIENCE.RUN_FROM_LINE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.RunFromLine) - public async runFromLine(targetLine: number) { - if (this.document && targetLine < this.document.lineCount) { - const iw = await this.getActiveInteractiveWindow(); -``` - -
-
- DATASCIENCE.RUN_INSERT_CELL_ABOVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.InsertCellAbove) - public insertCellAbove() { - const editor = this.documentManager.activeTextEditor; - if (editor && editor.selection) { -``` - -
-
- DATASCIENCE.RUN_INSERT_CELL_BELOW - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.InsertCellBelow) - public insertCellBelow() { - const editor = this.documentManager.activeTextEditor; - if (editor && editor.selection) { -``` - -
-
- DATASCIENCE.RUN_INSERT_CELL_BELOW_POSITION - -## Description - - - - - Cell Edit Commands in Interactive Python - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - ); - } - - @captureTelemetry(Telemetry.InsertCellBelowPosition) - public insertCellBelowPosition() { - const editor = this.documentManager.activeTextEditor; - if (editor && editor.selection) { -``` - -
-
- DATASCIENCE.RUN_MOVE_CELLS_DOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - await this.moveCellsDirection(true); - } - - @captureTelemetry(Telemetry.MoveCellsDown) - public async moveCellsDown(): Promise { - await this.moveCellsDirection(false); - } -``` - -
-
- DATASCIENCE.RUN_MOVE_CELLS_UP - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.MoveCellsUp) - public async moveCellsUp(): Promise { - await this.moveCellsDirection(true); - } -``` - -
-
- DATASCIENCE.RUN_SELECT_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - .then(noop, noop); - } - - @captureTelemetry(Telemetry.SelectCell) - public selectCell() { - const editor = this.documentManager.activeTextEditor; - if (editor && editor.selection) { -``` - -
-
- DATASCIENCE.RUN_SELECT_CELL_CONTENTS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.SelectCellContents) - public selectCellContents() { - const editor = this.documentManager.activeTextEditor; - if (!editor || !editor.selection) { -``` - -
-
- DATASCIENCE.RUN_SELECTION_OR_LINE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - await finished; - } - - @captureTelemetry(Telemetry.RunSelectionOrLine) - public async runSelectionOrLine(activeEditor: TextEditor | undefined, text?: string | Uri) { - if (this.document && activeEditor && urlPath.isEqual(activeEditor.document.uri, this.document.uri)) { - const iw = await this.getActiveInteractiveWindow(); -``` - -
-
- DATASCIENCE.RUN_TO_LINE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.RunToLine) - public async runToLine(targetLine: number) { - if (this.document && targetLine > 0) { - const iw = await this.getActiveInteractiveWindow(); -``` - -
-
- DATASCIENCE.SAVE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.SCROLLED_TO_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.SELECT_JUPYTER_INTERPRETER_Command - -## Description - - - - - Telemetry sent when user selects an interpreter to start jupyter server. - - @type {(never | undefined)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.node.ts) -```typescript - public async activate(): Promise { - this.disposables.push( - this.cmdManager.registerCommand('jupyter.selectJupyterInterpreter', () => { - sendTelemetryEvent(Telemetry.SelectJupyterInterpreterCommand); - this.service.selectInterpreter().ignoreErrors(); - }) - ); -``` - -
-
- DATASCIENCE.SELECT_JUPYTER_URI - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - @inject(IsWebExtension) private readonly isWebExtension: boolean - ) {} - - @captureTelemetry(Telemetry.SelectJupyterURI) - @traceDecoratorError('Failed to select Jupyter Uri') - public selectJupyterURI( - allowLocal: boolean, -``` - - -[src/kernels/jupyter/launcher/commandLineSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/commandLineSelector.ts) -```typescript - workspaceService.onDidChangeConfiguration(this.onDidChangeConfiguration.bind(this)); - } - - @captureTelemetry(Telemetry.SelectJupyterURI) - public selectJupyterCommandLine(file: Uri): Promise { - const multiStep = this.multiStepFactory.create<{}>(); - return multiStep.run(this.startSelectingCommandLine.bind(this, file), {}); -``` - -
-
- DATASCIENCE.SELECT_LOCAL_JUPYTER_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - // Else VSC is just setting a kernel for a notebook after it has opened. - if (existingKernel) { - const telemetryEvent = isLocalConnection(this.kernelConnection) - ? Telemetry.SelectLocalJupyterKernel - : Telemetry.SelectRemoteJupyterKernel; - sendKernelTelemetryEvent(document.uri, telemetryEvent); - this.notebookApi.notebookEditors -``` - -
-
- DATASCIENCE.SELECT_REMOTE_JUPYTER_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - if (existingKernel) { - const telemetryEvent = isLocalConnection(this.kernelConnection) - ? Telemetry.SelectLocalJupyterKernel - : Telemetry.SelectRemoteJupyterKernel; - sendKernelTelemetryEvent(document.uri, telemetryEvent); - this.notebookApi.notebookEditors - .filter((editor) => editor.notebook === document) -``` - -
-
- DATASCIENCE.SELFCERTSMESSAGECLOSE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) -```typescript - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - return false; -} -``` - - -[src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) -```typescript - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - return false; -} -``` - - -[src/platform/errors/errorHandler.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/errorHandler.ts) -```typescript - ) - .catch(noop); - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - }) - .then(noop, noop); -``` - - -[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) -```typescript - ); - return this.requestCreator.getFetchMethod()(url, this.addAllowUnauthorized(url, true, options)); - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - } - throw e; -``` - -
-
- DATASCIENCE.SELFCERTSMESSAGEENABLED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) -```typescript - closeOption - ); - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; - } else if (value === closeOption) { -``` - - -[src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) -```typescript - closeOption - ); - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; - } else if (value === closeOption) { -``` - - -[src/platform/errors/errorHandler.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/errorHandler.ts) -```typescript - .showErrorMessage(DataScience.jupyterSelfCertFail().format(err.message), enableOption, closeOption) - .then((value) => { - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - this.configuration - .updateSetting( - 'allowUnauthorizedRemoteConnection', -``` - - -[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) -```typescript - closeOption - ); - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - await this.configService.updateSetting( - 'allowUnauthorizedRemoteConnection', - true, -``` - -
-
- DATASCIENCE.SET_JUPYTER_URI_LOCAL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - return computeServerId(uri); - } - } - @captureTelemetry(Telemetry.SetJupyterURIToLocal) - public async setJupyterURIToLocal(): Promise { - await this.serverUriStorage.setUriToLocal(); - } -``` - -
-
- DATASCIENCE.SET_JUPYTER_URI_UI_DISPLAYED - -## Description - - - - - This telemetry tracks the display of the Picker for Jupyter Remote servers. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - allowLocal: boolean, - commandSource: SelectJupyterUriCommandSource = 'nonUser' - ): Promise { - sendTelemetryEvent(Telemetry.SetJupyterURIUIDisplayed, undefined, { - commandSource - }); - const multiStep = this.multiStepFactory.create<{}>(); -``` - -
-
- DATASCIENCE.SET_JUPYTER_URI_USER_SPECIFIED - -## Description - - -No description provided - -## Properties - -- - azure: boolean; - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - await this.serverUriStorage.setUriToRemote(userURI, connection.displayName); - - // Indicate setting a jupyter URI to a remote setting. Check if an azure remote or not - sendTelemetryEvent(Telemetry.SetJupyterURIToUserSpecified, undefined, { - azure: userURI.toLowerCase().includes('azure') - }); - } -``` - -
-
- DATASCIENCE.SHOW_DATA_EXPLORER - -## Description - - -No description provided - -## Properties - -- rows: number | undefined; -- columns: number | undefined - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) -```typescript - - // Log telemetry about number of rows - try { - sendTelemetryEvent(Telemetry.ShowDataViewer, 0, { - rows: output.rowCount ? output.rowCount : 0, - columns: output.columns ? output.columns.length : 0 - }); -``` - - -[src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) -```typescript - - private sendElapsedTimeTelemetry() { - if (this.rowsTimer && this.pendingRowsCount === 0) { - sendTelemetryEvent(Telemetry.ShowDataViewer, this.rowsTimer.elapsedTime); - } - } - -``` - -
-
- DATASCIENCE.START_SHOW_DATA_EXPLORER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewerFactory.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerFactory.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.StartShowDataViewer) - public async create(dataProvider: IDataViewerDataProvider, title: string): Promise { - let result: IDataViewer | undefined; - -``` - -
-
- DATASCIENCE.SUBMITCELLFROMREPL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.UNDO - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.USER_DID_NOT_INSTALL_JUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - } - - case DataScience.selectDifferentJupyterInterpreter(): { - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.selectAnotherInterpreter; - } - -``` - - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - - case DataScience.pythonInteractiveHelpLink(): { - this.applicationShell.openUrl(HelpLinks.PythonInteractiveHelpLink); - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.cancel; - } - -``` - - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - } - - default: - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.cancel; - } - } finally { -``` - -
-
- DATASCIENCE.USER_DID_NOT_INSTALL_PANDAS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) -```typescript - sendTelemetryEvent(Telemetry.UserInstalledPandas); - } - } else { - sendTelemetryEvent(Telemetry.UserDidNotInstallPandas); - throw new Error(DataScience.pandasRequiredForViewing()); - } - } -``` - -
-
- DATASCIENCE.USER_INSTALLED_JUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - return JupyterInterpreterDependencyResponse.cancel; - } - } - sendTelemetryEvent(Telemetry.UserInstalledJupyter); - - // Check if kernelspec module is something that accessible. - return this.checkKernelSpecAvailability(interpreter); -``` - -
-
- DATASCIENCE.USER_INSTALLED_MODULE - -## Description - - - - - Telemetry event sent when installing a jupyter dependency - - @type {product: string} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.USER_INSTALLED_PANDAS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) -```typescript - cancellationPromise - ]); - if (response === InstallerResponse.Installed) { - sendTelemetryEvent(Telemetry.UserInstalledPandas); - } - } else { - sendTelemetryEvent(Telemetry.UserDidNotInstallPandas); -``` - -
-
- DATASCIENCE.USER_STARTUP_CODE_FAILURE - -## Description - - -No description provided - -## Properties - -- - ename: string; -- - evalue: string; - -## Locations Used - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - await this.executeSilently(session, this.getUserStartupCommands(), { - traceErrors: true, - traceErrorsMessage: 'Error executing user defined startup code', - telemetryName: Telemetry.UserStartupCodeFailure - }); - } - -``` - -
-
- DATASCIENCE.VARIABLE_EXPLORER_TOGGLE - -## Description - - -No description provided - -## Properties - -- open: boolean; -- runByLine: boolean - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.VSCODE_NATIVE.CHANGE_TO_CODE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.VSCODE_NATIVE.CHANGE_TO_MARKDOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.VSCODE_NATIVE.DELETE_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.VSCODE_NATIVE.INSERT_CELL - -## Description - - - - Native notebooks events - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DATASCIENCE.VSCODE_NATIVE.MOVE_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.ACTIVE_INTERPRETER_LISTING_PERF - -## Description - - -No description provided - -## Properties - -- - /** - * Whether this is the first time in the session. - * (fetching kernels first time in the session is slower, later its cached). - * This is a generic property supported for all telemetry (sent by decorators). - */ - firstTime?: boolean; - -## Locations Used - -[src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) -```typescript - } - } - private workspaceCachedActiveInterpreter = new Map>(); - @captureTelemetry(Telemetry.ActiveInterpreterListingPerf) - @traceDecoratorVerbose('Get Active Interpreter', TraceOptions.Arguments | TraceOptions.BeforeCall) - public getActiveInterpreter(resource?: Uri): Promise { - this.hookupOnDidChangeInterpreterEvent(); -``` - -
-
- DS_INTERNAL.ASK_USER_FOR_NEW_KERNEL_JUPYTER - -## Description - - - - - Sent when a jupyter session fails to start and we ask the user for a new kernel - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.CELL_COUNT - -## Description - - -No description provided - -## Properties - -- count: number - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.CODE_LENS_ACQ_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/editor-integration/codelensprovider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codelensprovider.ts) -```typescript - // On shutdown send how long on average we spent parsing code lens - if (this.totalGetCodeLensCalls > 0) { - sendTelemetryEvent( - Telemetry.CodeLensAverageAcquisitionTime, - this.totalExecutionTimeInMs / this.totalGetCodeLensCalls - ); - } -``` - -
-
- DS_INTERNAL.COMMAND_EXECUTED - -## Description - - - - - Telemetry sent when a command is executed. - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/application/commandManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts) -```typescript - return commands.registerCommand( - command, - (...args: U) => { - sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); - if (thisArg) { - return callback.call(thisArg, ...(args as any)); - } else { -``` - - -[src/platform/common/application/commandManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts) -```typescript - return commands.registerTextEditorCommand( - command, - (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => { - sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); - if (thisArg) { - return callback.call(thisArg, textEditor, edit, ...args); - } else { -``` - - -[src/platform/common/application/commandManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts) -```typescript - U extends ICommandNameArgumentTypeMapping[E] - >(command: E, ...rest: U): Thenable { - if (!commandsToIgnore.has(command)) { - sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); - } - return commands.executeCommand(command, ...rest); - } -``` - -
-
- DS_INTERNAL.COMPLETION_TIME_FROM_JUPYTER - -## Description - - - - - Telemetry event sent to capture total time taken for completions list to be provided by Jupyter. - This is used to compare against time taken by LS. - - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.COMPLETION_TIME_FROM_LS - -## Description - - - - - Telemetry event sent to capture total time taken for completions list to be provided by LS. - This is used to compare against time taken by Jupyter. - - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.CONNECTFAILEDJUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - throw new RemoteJupyterServerConnectionError(connection.baseUrl, options.serverId, err); - } - } else { - sendTelemetryEvent(Telemetry.ConnectFailedJupyter, undefined, undefined, err, true); - throw new LocalJupyterServerConnectionError(err); - } - } else { -``` - -
-
- DS_INTERNAL.CONNECTLOCALJUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - traceInfo(`Connection complete server`); - - sendTelemetryEvent( - options.localJupyter ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter - ); - return result; - } catch (err) { -``` - -
-
- DS_INTERNAL.CONNECTREMOTEEXPIREDCERTFAILEDJUPYTER - -## Description - - - - - Jupyter server's certificate has expired. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - throw new JupyterSelfCertsError(connection.baseUrl); - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteExpiredCertFailedJupyter); - throw new JupyterSelfCertsExpiredError(connection.baseUrl); - } else { - throw new RemoteJupyterServerConnectionError(connection.baseUrl, options.serverId, err); -``` - -
-
- DS_INTERNAL.CONNECTREMOTEFAILEDJUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - - // Something else went wrong - if (!options.localJupyter) { - sendTelemetryEvent(Telemetry.ConnectRemoteFailedJupyter, undefined, undefined, err, true); - - // Check for the self signed certs error specifically - if (JupyterSelfCertsError.isSelfCertsError(err)) { -``` - -
-
- DS_INTERNAL.CONNECTREMOTEJUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - traceInfo(`Connection complete server`); - - sendTelemetryEvent( - options.localJupyter ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter - ); - return result; - } catch (err) { -``` - -
-
- DS_INTERNAL.CONNECTREMOTEJUPYTER_VIA_LOCALHOST - -## Description - - - - - Connecting to an existing Jupyter server, but connecting to localhost. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - connection = await this.startOrConnect(options, cancelToken); - - if (!connection.localLaunch && LocalHosts.includes(connection.hostName.toLowerCase())) { - sendTelemetryEvent(Telemetry.ConnectRemoteJupyterViaLocalHost); - } - // eslint-disable-next-line no-constant-condition - traceInfo(`Connecting to process server`); -``` - -
-
- DS_INTERNAL.CONNECTREMOTESELFCERTFAILEDJUPYTER - -## Description - - - - - Jupyter server's certificate is not from a trusted authority. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - } - } catch (err) { - if (JupyterSelfCertsError.isSelfCertsError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { - return; -``` - - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - return; - } - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { - return; -``` - - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - } catch (err) { - traceWarning('Uri verification error', err); - if (JupyterSelfCertsError.isSelfCertsError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { - return DataScience.jupyterSelfCertFailErrorMessageOnly(); -``` - - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - return DataScience.jupyterSelfCertFailErrorMessageOnly(); - } - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { - return DataScience.jupyterSelfCertExpiredErrorMessageOnly(); -``` - - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - - // Check for the self signed certs error specifically - if (JupyterSelfCertsError.isSelfCertsError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - throw new JupyterSelfCertsError(connection.baseUrl); - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteExpiredCertFailedJupyter); -``` - -
-
- DS_INTERNAL.ERROR_START_RAWKERNEL_WITHOUT_INTERPRETER - -## Description - - - - Whether we've attempted to start a raw Python kernel without any interpreter information. - If we don't detect such telemetry in a few months, then we can remove this along with the temporary code associated with this telemetry. - -## Properties - -- - /** - * Indicates whether the python extension is installed. - * If we send telemetry fro this & this is `true`, then we have a bug. - * If its `false`, then we can ignore this telemetry. - */ - pythonExtensionInstalled: boolean; - -## Locations Used - -[src/kernels/raw/session/hostRawNotebookProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/hostRawNotebookProvider.node.ts) -```typescript - kernelConnection.kind === 'startUsingLocalKernelSpec' - ) { - if (!kernelConnection.interpreter) { - sendTelemetryEvent(Telemetry.AttemptedToLaunchRawKernelWithoutInterpreter, undefined, { - pythonExtensionInstalled: this.extensionChecker.isPythonExtensionInstalled - }); - } -``` - -
-
- DS_INTERNAL.EXECUTE_CELL_PERCEIVED_COLD - -## Description - - - - - Telemetry sent to capture first time execution of a cell. - If `notebook = true`, this its telemetry for native editor/notebooks. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/cellExecution.ts) -```typescript - const props = { notebook: true }; - if (!CellExecution.sentExecuteCellTelemetry) { - CellExecution.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); - } -``` - - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - if (runningStopWatch) { - if (!CodeWatcher.sentExecuteCellTelemetry) { - CodeWatcher.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, runningStopWatch.elapsedTime); - } -``` - -
-
- DS_INTERNAL.EXECUTE_CELL_PERCEIVED_WARM - -## Description - - - - - Telemetry sent to capture subsequent execution of a cell. - If `notebook = true`, this its telemetry for native editor/notebooks. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/cellExecution.ts) -```typescript - CellExecution.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); - } - } - private canExecuteCell() { -``` - - -[src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) -```typescript - CodeWatcher.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, runningStopWatch.elapsedTime); - } - } - } -``` - - -[src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) -```typescript - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.RunFileInteractive); - assertEvent(Telemetry.ExecuteCellPerceivedWarm); - assertEvent(Telemetry.SwitchKernel); - }); -}); -``` - -
-
- DS_INTERNAL.FAILED_TO_UPDATE_JUPYTER_KERNEL_SPEC - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) -```typescript - await this.fs.writeLocalFile(kernelSpecFilePath.fsPath, JSON.stringify(contents, undefined, 4)); - } catch (ex) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); - throw ex; - } - if (cancelToken.isCancellationRequested) { -``` - - -[src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) -```typescript - await this.fs.writeLocalFile(kernelSpecFilePath, JSON.stringify(specModel, undefined, 2)); - } catch (ex) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); - throw ex; - } - } -``` - -
-
- DS_INTERNAL.FIND_JUPYTER_COMMAND - -## Description - - -No description provided - -## Properties - -- command: string - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.FIND_JUPYTER_KERNEL_SPEC - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.FIND_KERNEL_FOR_LOCAL_CONNECTION - -## Description - - - - - Telemetry event sent once done searching for kernel spec and interpreter for a local connection. - - @type {{ - kernelSpecFound: boolean; - interpreterFound: boolean; - }} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.GET_ACTIVATED_ENV_VARIABLES - -## Description - - - - - Used to capture time taken to get enviornment variables for a python environment. - Also lets us know whether it worked or not. - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - ]); - - const envType = interpreter.envType; - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, - source: 'python', -``` - - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - interpreter?.uri - )}, shell cannot be determined.` - ); - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, 0, { - envType, - pythonEnvType: envType, - source: 'jupyter', -``` - - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - const stopWatch = new StopWatch(); - try { - const env = await this.getCondaEnvVariables(resource, interpreter); - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, - source: 'jupyter', -``` - - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - }); - return env; - } catch (ex) { - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, - source: 'jupyter', -``` - - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - const processService = await processServicePromise; - const hasCustomEnvVars = Object.keys(customEnvVars).length; - if (!activationCommands || activationCommands.length === 0) { - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, - source: 'jupyter', -``` - - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - } else if (returnedEnv) { - delete returnedEnv[PYTHON_WARNINGS]; - } - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, - source: 'jupyter', -``` - - -[src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) -```typescript - - return returnedEnv; - } catch (e) { - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, - source: 'jupyter', -``` - -
-
- DS_INTERNAL.GET_PASSWORD_FAILURE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) -```typescript - const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; - return { requestHeaders }; - } else { - sendTelemetryEvent(Telemetry.GetPasswordFailure); - return undefined; - } - } -``` - -
-
- DS_INTERNAL.GET_PASSWORD_SUCCESS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) -```typescript - - // If we found everything return it all back if not, undefined as partial is useless - if (xsrfCookie && sessionCookieName && sessionCookieValue) { - sendTelemetryEvent(Telemetry.GetPasswordSuccess); - const cookieString = this.getSessionCookieString(xsrfCookie, sessionCookieName, sessionCookieValue); - const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; - return { requestHeaders }; -``` - -
-
- DS_INTERNAL.GET_PREFERRED_KERNEL_PERF - -## Description - - - - - Total time taken to get the preferred kernel for notebook. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.HASHED_NOTEBOOK_OUTPUT_MIME_TYPE_PERF - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.HASHED_OUTPUT_MIME_TYPE - -## Description - - -No description provided - -## Properties - -- - /** - * Hash of the cell output mimetype - * - * @type {string} - */ - hashedName: string; -- - hasText: boolean; -- - hasLatex: boolean; -- - hasHtml: boolean; -- - hasSvg: boolean; -- - hasXml: boolean; -- - hasJson: boolean; -- - hasImage: boolean; -- - hasGeo: boolean; -- - hasPlotly: boolean; -- - hasVega: boolean; -- - hasWidget: boolean; -- - hasJupyter: boolean; -- - hasVnd: boolean; - -## Locations Used - -[src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts) -```typescript - hasJupyter: lowerMimeType.includes('jupyter'), - hasVnd: lowerMimeType.includes('vnd') - }; - sendTelemetryEvent(Telemetry.HashedCellOutputMimeType, undefined, props); - } -} - -``` - -
-
- DS_INTERNAL.HASHED_OUTPUT_MIME_TYPE_PERF - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts) -```typescript - this.pendingChecks.set(id, setTimeout(check, 5000)); - } - - @captureTelemetry(Telemetry.HashedCellOutputMimeTypePerf) - private checkCell(cell: NotebookCell) { - this.pendingChecks.delete(cell.document.uri.toString()); - this.getCellOutputMimeTypes(cell).forEach(this.sendTelemetry.bind(this)); -``` - -
-
- DS_INTERNAL.HIDDEN_EXECUTION_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.INTERACTIVE_FILE_TOOLTIPS_PERF - -## Description - - - - Capture telemetry re: how long returning a tooltip takes - -## Properties - -- - // Result is null if user signalled cancellation or if we timed out - isResultNull: boolean; - -## Locations Used - -[src/interactive-window/editor-integration/hoverProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/hoverProvider.ts) -```typescript - const timeoutHandler = sleep(300).then(() => undefined); - this.stopWatch.reset(); - const result = await Promise.race([timeoutHandler, this.getVariableHover(document, position, token)]); - sendTelemetryEvent(Telemetry.InteractiveFileTooltipsPerf, this.stopWatch.elapsedTime, { - isResultNull: !!result - }); - return result; -``` - -
-
- DS_INTERNAL.INTERPRETER_LISTING_PERF - -## Description - - - - - Time taken to list the Python interpreters. - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) -```typescript - return this.didChangeInterpreters.event; - } - - @captureTelemetry(Telemetry.InterpreterListingPerf) - @traceDecoratorVerbose('Get Interpreters', TraceOptions.Arguments | TraceOptions.BeforeCall) - public getInterpreters(resource?: Uri): Promise { - this.hookupOnDidChangeInterpreterEvent(); -``` - -
-
- DS_INTERNAL.INTERRUPT_JUPYTER_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) -```typescript - return newCellExecutionQueue; - } - @captureTelemetry(Telemetry.Interrupt) - @captureTelemetry(Telemetry.InterruptJupyterTime) - private async interruptExecution( - session: IJupyterSession, - pendingCells: Promise -``` - -
-
- DS_INTERNAL.INVALID_KERNEL_USED - -## Description - - - - - Telemetry event sent when a kernel picked crashes on startup - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/errors/jupyterInvalidKernelError.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/jupyterInvalidKernelError.ts) -```typescript - DataScience.kernelInvalid().format(getDisplayNameOrNameOfKernelConnection(kernelConnectionMetadata)), - kernelConnectionMetadata - ); - sendTelemetryEvent(Telemetry.KernelInvalid); - } -} - -``` - -
-
- DS_INTERNAL.IPYWIDGET_DISCOVERED - -## Description - - - - - Telemetry event sent with name of a Widget found. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.IPYWIDGET_DISCOVERY_ERRORED - -## Description - - - - - Something went wrong in looking for a widget. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts) -```typescript - widgetSource = await this.scriptProvider.getWidgetScriptSource(moduleName, moduleVersion); - } catch (ex) { - traceError('Failed to get widget source due to an error', ex); - sendTelemetryEvent(Telemetry.HashedIPyWidgetScriptDiscoveryError); - } finally { - traceInfo( - `${ConsoleForegroundColors.Green}Script for ${moduleName}, is ${widgetSource.scriptUri} from ${widgetSource.source}` -``` - -
-
- DS_INTERNAL.IPYWIDGET_LOAD_DISABLED - -## Description - - - - - Telemetry event sent when an loading of 3rd party ipywidget JS scripts from 3rd party source has been disabled. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.IPYWIDGET_LOAD_FAILURE - -## Description - - - - - Telemetry event sent when an ipywidget module fails to load. Module name is hashed. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts) -```typescript - } - traceError(`Widget load failure ${errorMessage}`, payload); - - sendTelemetryEvent(Telemetry.IPyWidgetLoadFailure, 0, { - isOnline: payload.isOnline, - moduleHash: getTelemetrySafeHashedString(payload.moduleName), - moduleVersion: payload.moduleVersion, -``` - -
-
- DS_INTERNAL.IPYWIDGET_LOAD_SUCCESS - -## Description - - - - - Telemetry event sent when an ipywidget module loads. Module name is hashed. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts) -```typescript - - private sendLoadSucceededTelemetry(payload: LoadIPyWidgetClassLoadAction) { - try { - sendTelemetryEvent(Telemetry.IPyWidgetLoadSuccess, 0, { - moduleHash: getTelemetrySafeHashedString(payload.moduleName), - moduleVersion: payload.moduleVersion - }); -``` - -
-
- DS_INTERNAL.IPYWIDGET_OVERHEAD - -## Description - - - - - Telemetry event sent to indicate the overhead of syncing the kernel with the UI. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts) -```typescript - } - - private sendOverheadTelemetry() { - sendTelemetryEvent(Telemetry.IPyWidgetOverhead, 0, { - totalOverheadInMs: this.totalWaitTime, - numberOfMessagesWaitedOn: this.totalWaitedMessages, - averageWaitTime: this.totalWaitTime / this.totalWaitedMessages, -``` - -
-
- DS_INTERNAL.IPYWIDGET_PROMPT_TO_USE_CDN - -## Description - - - - - Telemetry sent when we prompt user to use a CDN for IPyWidget scripts. - This is always sent when we display a prompt. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts) -```typescript - return this.configurationPromise.promise; - } - this.configurationPromise = createDeferred(); - sendTelemetryEvent(Telemetry.IPyWidgetPromptToUseCDN); - const selection = await this.appShell.showInformationMessage( - DataScience.useCDNForWidgets(), - Common.ok(), -``` - -
-
- DS_INTERNAL.IPYWIDGET_PROMPT_TO_USE_CDN_SELECTION - -## Description - - - - - Telemetry sent when user does something with the prompt displayed to user about using CDN for IPyWidget scripts. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts) -```typescript - break; - } - - sendTelemetryEvent(Telemetry.IPyWidgetPromptToUseCDNSelection, undefined, { selection: selectionForTelemetry }); - this.configurationPromise.resolve(); - } - private async updateScriptSources(scriptSources: WidgetCDNs[]) { -``` - -
-
- DS_INTERNAL.IPYWIDGET_RENDER_FAILURE - -## Description - - - - - Telemetry event sent when the widget render function fails (note, this may not be sufficient to capture all failures). - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts) -```typescript - private sendRenderFailureTelemetry(payload: Error) { - try { - traceError('Error rendering a widget: ', payload); - sendTelemetryEvent(Telemetry.IPyWidgetRenderFailure); - } catch { - // Do nothing on a failure - } -``` - -
-
- DS_INTERNAL.IPYWIDGET_TEST_AVAILABILITY_ON_CDN - -## Description - - - - - Total time taken to discover a widget script on CDN. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.IPYWIDGET_TEST_AVAILABILITY_ON_LOCAL - -## Description - - - - - Total time taken to discover all IPyWidgets on disc. - This is how long it takes to discover a single widget on disc (from python environment). - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.node.ts) -```typescript - } - return (this.cachedWidgetScripts = this.getWidgetScriptSourcesWithoutCache()); - } - @captureTelemetry(Telemetry.DiscoverIPyWidgetNamesLocalPerf) - private async getWidgetScriptSourcesWithoutCache(): Promise { - const sysPrefix = await this.getSysPrefixOfKernel(); - if (!sysPrefix) { -``` - -
-
- DS_INTERNAL.IPYWIDGET_UNHANDLED_MESSAGE - -## Description - - - - - Telemetry event sent when the widget tries to send a kernel message but nothing was listening - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts) -```typescript - this.jupyterOutput.appendLine( - DataScience.unhandledMessage().format(msg.header.msg_type, JSON.stringify(msg.content)) - ); - sendTelemetryEvent(Telemetry.IPyWidgetUnhandledMessage, undefined, { msg_type: msg.header.msg_type }); - } catch { - // Don't care if this doesn't get logged - } -``` - -
-
- DS_INTERNAL.IPYWIDGET_USED_BY_USER - -## Description - - - - - Telemetry event sent with name of a Widget that is used. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts) -```typescript - } - } - - sendTelemetryEvent(Telemetry.HashedIPyWidgetNameUsed, undefined, { - hashedName: getTelemetrySafeHashedString(found.moduleName), - source: found.source, - cdnSearched: this.configuredScriptSources.length > 0 -``` - -
-
- DS_INTERNAL.IPYWIDGET_WIDGET_VERSION_NOT_SUPPORTED_LOAD_FAILURE - -## Description - - - - - Telemetry event sent when an ipywidget version that is not supported is used & we have trapped this and warned the user about it. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts) -```typescript - } - private sendUnsupportedWidgetVersionFailureTelemetry(payload: NotifyIPyWidgetWidgetVersionNotSupportedAction) { - try { - sendTelemetryEvent(Telemetry.IPyWidgetWidgetVersionNotSupportedLoadFailure, 0, { - moduleHash: getTelemetrySafeHashedString(payload.moduleName), - moduleVersion: payload.moduleVersion - }); -``` - -
-
- DS_INTERNAL.JUPYTER_CREATING_NOTEBOOK - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts) -```typescript - this.throwIfDisposedOrCancelled(cancelToken); - const baseUrl = this.connection?.baseUrl || ''; - this.logRemoteOutput(DataScience.createdNewNotebook().format(baseUrl)); - sendKernelTelemetryEvent(resource, Telemetry.JupyterCreatingNotebook, stopWatch.elapsedTime); - return session; - } catch (ex) { - sendKernelTelemetryEvent( -``` - - -[src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts) -```typescript - } catch (ex) { - sendKernelTelemetryEvent( - resource, - Telemetry.JupyterCreatingNotebook, - stopWatch.elapsedTime, - undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any -``` - -
-
- DS_INTERNAL.JUPYTER_CUSTOM_COMMAND_LINE - -## Description - - - - - Telemetry event sent to when user customizes the jupyter command line - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/commandLineSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/commandLineSelector.ts) -```typescript - - private async setJupyterCommandLine(val: string): Promise { - if (val) { - sendTelemetryEvent(Telemetry.JupyterCommandLineNonDefault); - } - const split = parseArgsStringToArgv(val); - await this.configuration.updateSetting( -``` - -
-
- DS_INTERNAL.JUPYTER_IDLE_TIMEOUT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/errors/jupyterWaitForIdleError.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/jupyterWaitForIdleError.ts) -```typescript -export class JupyterWaitForIdleError extends BaseKernelError { - constructor(kernelConnectionMetadata: KernelConnectionMetadata) { - super('timeout', DataScience.jupyterLaunchTimedOut(), kernelConnectionMetadata); - sendTelemetryEvent(Telemetry.SessionIdleTimeout); - } -} - -``` - -
-
- DS_INTERNAL.JUPYTER_INSTALL_FAILED - -## Description - - - - - Telemetry event sent if there's an error installing a jupyter required dependency - - @type { product: string } - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.JUPYTER_INTALLED_BUT_NO_KERNELSPEC_MODULE - -## Description - - - - - Telemetry event sent when jupyter has been found in interpreter but we cannot find kernelspec. - - @type {(never | undefined)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - return JupyterInterpreterDependencyResponse.ok; - } - // Indicate no kernel spec module. - sendTelemetryEvent(Telemetry.JupyterInstalledButNotKernelSpecModule); - if (Cancellation.isCanceled(token)) { - return JupyterInterpreterDependencyResponse.cancel; - } -``` - -
-
- DS_INTERNAL.JUPYTER_REGISTER_INTERPRETER_AS_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) -```typescript - */ - // eslint-disable-next-line - // eslint-disable-next-line complexity - @captureTelemetry(Telemetry.RegisterInterpreterAsKernel, undefined, true) - @traceDecoratorError('Failed to register an interpreter as a kernel') - // eslint-disable-next-line - private async registerKernel( -``` - -
-
- DS_INTERNAL.JUPYTER_START_TIMEOUT - -## Description - - -No description provided - -## Properties - -- - /** - * Total time spent in attempting to start and connect to jupyter before giving up. - * - * @type {number} - */ - timeout: number; - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.JUPYTERSTARTUPCOST - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) -```typescript - } - - // eslint-disable-next-line - @captureTelemetry(Telemetry.StartJupyter) - private async startNotebookServer( - resource: Resource, - useDefaultConfig: boolean, -``` - -
-
- DS_INTERNAL.KERNEL_COUNT - -## Description - - - - Misc - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/kernelTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/kernelTelemetry.ts) -```typescript - }); - trackKernelResourceInformation(resource, counters); - if (stopWatch) { - sendKernelTelemetryEvent(resource, Telemetry.KernelCount, stopWatch.elapsedTime, counters); - } -} - -``` - -
-
- DS_INTERNAL.KERNEL_ENUMERATION - -## Description - - - - - Telemetry event sent to every time a kernel enumeration is done - - @type {...} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.KERNEL_LAUNCHER_PERF - -## Description - - - - - Total time taken to Launch a raw kernel. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/launcher/kernelLauncher.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelLauncher.node.ts) -```typescript - // Should be available now, wait with a timeout - return await this.launchProcess(kernelConnectionMetadata, resource, workingDirectory, timeout, cancelToken); - })(); - sendKernelTelemetryWhenDone(resource, Telemetry.KernelLauncherPerf, promise); - return promise; - } - -``` - -
-
- DS_INTERNAL.KERNEL_LISTING_PERF - -## Description - - -No description provided - -## Properties - -- - /** - * Whether this is the first time in the session. - * (fetching kernels first time in the session is slower, later its cached). - * This is a generic property supported for all telemetry (sent by decorators). - */ - firstTime?: boolean; -- - /** - * Whether this telemetry is for listing of all kernels or just python or just non-python. - * (fetching kernels first time in the session is slower, later its cached). - */ - kind: 'remote' | 'local' | 'localKernelSpec' | 'localPython'; - -## Locations Used - -[src/kernels/raw/finder/localKnownPathKernelSpecFinder.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKnownPathKernelSpecFinder.node.ts) -```typescript - /** - * @param {boolean} includePythonKernels Include/exclude Python kernels in the result. - */ - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localKernelSpec' }) - public async listKernelSpecs( - includePythonKernels: boolean, - cancelToken?: CancellationToken -``` - - -[src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.node.ts) -```typescript - ) { - super(fs, workspaceService, extensionChecker, globalState); - } - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localPython' }) - public async listKernelSpecs(resource: Resource, ignoreCache?: boolean, cancelToken?: CancellationToken) { - // Get an id for the workspace folder, if we don't have one, use the fsPath of the resource - const workspaceFolderId = -``` - - -[src/kernels/raw/finder/localKernelFinder.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKernelFinder.node.ts) -```typescript - * Search all our local file system locations for installed kernel specs and return them - */ - @traceDecoratorError('List kernels failed') - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'local' }) - public async listKernels( - resource: Resource, - @ignoreLogging() cancelToken?: CancellationToken -``` - - -[src/kernels/jupyter/remoteKernelFinder.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/remoteKernelFinder.ts) -```typescript - ) {} - - // Talk to the remote server to determine sessions - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'remote' }) - public async listKernels( - _resource: Resource, - connInfo: INotebookProviderConnection, -``` - -
-
- DS_INTERNAL.KERNEL_NOT_INSTALLED - -## Description - - -No description provided - -## Properties - -- - action: 'displayed'; -- // Message displayed. - /** - * Language found in the notebook if a known language. Otherwise 'unknown' - */ - language: string; - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.KERNEL_PROVIDER_PERF - -## Description - - - - - Total time taken to list kernels for VS Code. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.KERNEL_REGISTER_FAILED - -## Description - - - - - Telemetry event sent to indicate registering a kernel with jupyter failed. - - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.KERNEL_SPEC_NOT_FOUND - -## Description - - - - - Telemetry event sent to indicate 'jupyter kernelspec' is not possible. - - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - .then(() => true) - .catch((e) => { - traceError(`Kernel spec not found: `, e); - sendTelemetryEvent(Telemetry.KernelSpecNotFound); - return false; - }); - } -``` - -
-
- DS_INTERNAL.LOCAL_KERNEL_SPEC_COUNT - -## Description - - -No description provided - -## Properties - -- - /** - * Number of kernel specs. - */ - count: number; - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.NATIVE_VARIABLE_VIEW_LOADED - -## Description - - - - Native variable view events - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) -```typescript - this.dataViewerChecker = new DataViewerChecker(configuration, appShell); - } - - @captureTelemetry(Telemetry.NativeVariableViewLoaded) - public async load(codeWebview: vscodeWebviewView) { - await super.loadWebview(Uri.file(process.cwd()), codeWebview).catch(traceError); - -``` - -
-
- DS_INTERNAL.NATIVE_VARIABLE_VIEW_MADE_VISIBLE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) -```typescript - - // I've we've been made visible, make sure that we are updated - if (visible) { - sendTelemetryEvent(Telemetry.NativeVariableViewMadeVisible); - // If there is an active execution count, update the view with that info - // Keep the variables up to date if document has run cells while the view was not visible - if (this.notebookWatcher.activeNotebookExecutionCount !== undefined) { -``` - -
-
- DS_INTERNAL.NATIVE.NOTEBOOK_OPEN_COUNT - -## Description - - -No description provided - -## Properties - -- count: number - -## Locations Used - -[src/notebooks/notebookUsageTracker.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookUsageTracker.ts) -```typescript - public dispose() { - // Send a bunch of telemetry - if (this.openedNotebookCount) { - sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); - } - if (this.executedNotebooksIndexedByUri.size) { - sendTelemetryEvent(Telemetry.NotebookRunCount, undefined, { -``` - -
-
- DS_INTERNAL.NATIVE.NOTEBOOK_OPEN_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.NATIVE.NOTEBOOK_RUN_COUNT - -## Description - - -No description provided - -## Properties - -- count: number - -## Locations Used - -[src/notebooks/notebookUsageTracker.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookUsageTracker.ts) -```typescript - sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); - } - if (this.executedNotebooksIndexedByUri.size) { - sendTelemetryEvent(Telemetry.NotebookRunCount, undefined, { - count: this.executedNotebooksIndexedByUri.size - }); - } -``` - -
-
- DS_INTERNAL.NATIVE.OPEN_NOTEBOOK_FAILURE - -## Description - - - - - Telemetry event fired if a failure occurs loading a notebook - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.NEW_FILE_USED_IN_INTERACTIVE - -## Description - - - - - Telemetry event sent when a user runs the interactive window with a new file - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.NUMBER_OF_REMOTE_KERNEL_IDS_SAVED - -## Description - - - - When users connect to a remote kernel, we store the kernel id so we can re-connect to that - when user opens the same notebook. We only store the last 100. - Count is the number of entries saved in the list. - -## Properties - -- count: number - -## Locations Used - -[src/kernels/jupyter/preferredRemoteKernelIdProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/preferredRemoteKernelIdProvider.ts) -```typescript - } - - // Prune list if too big - sendTelemetryEvent(Telemetry.NumberOfSavedRemoteKernelIds, undefined, { count: list.length }); - while (list.length > MaximumKernelIdListSize) { - requiresUpdate = true; - list.shift(); -``` - -
-
- DS_INTERNAL.PERCEIVED_JUPYTER_STARTUP_NOTEBOOK - -## Description - - - - - Time take for jupyter server to start and be ready to run first user cell. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - // Setup telemetry - if (!this.perceivedJupyterStartupTelemetryCaptured) { - this.perceivedJupyterStartupTelemetryCaptured = true; - sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); - executionPromise - .finally(() => - sendTelemetryEvent(Telemetry.StartExecuteNotebookCellPerceivedCold, stopWatch.elapsedTime) -``` - - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - - sendKernelTelemetryEvent( - this.resourceUri, - Telemetry.PerceivedJupyterStartupNotebook, - stopWatch.elapsedTime - ); - this._session = session; -``` - -
-
- DS_INTERNAL.PREFERRED_KERNEL - -## Description - - - - - Telemetry sent when we have attempted to find the preferred kernel. - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/notebookControllerManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts) -```typescript - ? PYTHON_LANGUAGE - : getTelemetrySafeLanguage(getLanguageInNotebookMetadata(notebookMetadata) || ''); - - sendTelemetryEvent(Telemetry.PreferredKernel, undefined, { - result: preferredConnection ? 'found' : 'notfound', - resourceType, - language: telemetrySafeLanguage, -``` - -
-
- DS_INTERNAL.PREFERRED_KERNEL_EXACT_MATCH - -## Description - - -No description provided - -## Properties - -- - matchedReason: PreferredKernelExactMatchReason; - -## Locations Used - -[src/notebooks/controllers/notebookControllerManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts) -```typescript - onlyConnection && (matchReason |= PreferredKernelExactMatchReason.OnlyKernel); - topMatchIsPreferredInterpreter && (matchReason |= PreferredKernelExactMatchReason.WasPreferredInterpreter); - isExactMatch && (matchReason |= PreferredKernelExactMatchReason.IsExactMatch); - sendTelemetryEvent(Telemetry.PreferredKernelExactMatch, undefined, { - matchedReason: matchReason - }); - } -``` - -
-
- DS_INTERNAL.PYTHON_EXTENSION_NOT_INSTALLED - -## Description - - -No description provided - -## Properties - -- - action: - | 'displayed' // Message displayed. - | 'dismissed' // user dismissed the message. - | 'download'; - -## Locations Used - -[src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) -```typescript - // Ask user if they want to install and then wait for them to actually install it. - const yes = localize.Common.bannerLabelYes(); - const no = localize.Common.bannerLabelNo(); - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const answer = await this.appShell.showInformationMessage( - localize.DataScience.pythonExtensionRequired(), - { modal: true }, -``` - - -[src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) -```typescript - no - ); - if (answer === yes) { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - await this.installPythonExtension(); - } else { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); -``` - - -[src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) -```typescript - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - await this.installPythonExtension(); - } else { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); - } - } - private async installPythonExtension() { -``` - - -[src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) -```typescript - } - } - private async handleExecutionWithoutPythonExtension() { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const selection = await this.appShell.showInformationMessage( - DataScience.pythonExtensionRequiredToRunNotebook(), - { modal: true }, -``` - - -[src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) -```typescript - Common.install() - ); - if (selection === Common.install()) { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); - } else { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); -``` - - -[src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) -```typescript - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); - } else { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); - } - } - private async handleExecutionWithoutPython() { -``` - -
-
- DS_INTERNAL.PYTHON_KERNEL_EXECUTABLE_MATCHES - -## Description - - - - - Telemetry sent for local Python Kernels. - Tracking whether we have managed to launch the kernel that matches the interpreter. - If match=false, then this means we have failed to launch the right kernel. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/helpers.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.node.ts) -```typescript - } - const sysExecutable = concatMultilineString(output.text).trim().toLowerCase(); - const match = areInterpreterPathsSame(kernelConnection.interpreter.uri, Uri.file(sysExecutable)); - sendTelemetryEvent(Telemetry.PythonKerneExecutableMatches, undefined, { - match: match ? 'true' : 'false', - kernelConnectionType: kernelConnection.kind - }); -``` - - -[src/kernels/helpers.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.node.ts) -```typescript - Uri.file(execOutput.stdout.trim().toLowerCase()), - Uri.file(sysExecutable) - ); - sendTelemetryEvent(Telemetry.PythonKerneExecutableMatches, undefined, { - match: match ? 'true' : 'false', - kernelConnectionType: kernelConnection.kind - }); -``` - -
-
- DS_INTERNAL.PYTHON_MODULE_INSTALL - -## Description - - -No description provided - -## Properties - -- - moduleName: string; -- - /** - * Whether the module was already (once before) installed into the python environment or - * whether this already exists (detected via `pip list`) - */ - isModulePresent?: 'true' | undefined; -- - action: - | 'cancelled' // User cancelled the installation or closed the notebook or the like. - | 'displayed' // Install prompt may have been displayed. - | 'prompted' // Install prompt was displayed. - | 'installed' // Installation disabled (this is what python extension returns). - | 'ignored' // Installation disabled (this is what python extension returns). - | 'disabled' // Installation disabled (this is what python extension returns). - | 'failed' // Installation disabled (this is what python extension returns). - | 'install' // User chose install from prompt. - | 'donotinstall' // User chose not to install from prompt. - | 'differentKernel' // User chose to select a different kernel. - | 'error' // Some other error. - | 'installedInJupyter' // The package was successfully installed in Jupyter whilst failed to install in Python ext. - | 'failedToInstallInJupyter' // Failed to install the package in Jupyter as well as Python ext. - | 'dismissed'; -- // User chose to dismiss the prompt. - resourceType?: 'notebook' | 'interactive'; -- - /** - * Hash of the resource (notebook.uri or pythonfile.uri associated with this). - * If we run the same notebook tomorrow, the hash will be the same. - */ - resourceHash?: string; -- - pythonEnvType?: EnvironmentType; - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) -```typescript - pipInstalledInNonCondaEnv === false ? [Product.pip].concat(missingProducts) : missingProducts, - interpreter.displayName - ); - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'displayed', - moduleName: ProductNames.get(Product.jupyter)!, - pythonEnvType: interpreter.envType -``` - - -[src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) -```typescript - interpreter: PythonEnvironment, - tokenSource: CancellationTokenSource - ): Promise { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'displayed', - moduleName: ProductNames.get(Product.pandas)!, - pythonEnvType: interpreter?.envType -``` - - -[src/kernels/installer/productInstaller.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/installer/productInstaller.node.ts) -```typescript - action = 'failed'; - throw ex; - } finally { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action, - moduleName: ProductNames.get(product)! - }); -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - const productNameForTelemetry = products.map((product) => ProductNames.get(product)!).join(', '); - const resourceType = resource ? getResourceType(resource) : undefined; - const resourceHash = resource ? getTelemetrySafeHashedString(resource.toString()) : undefined; - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'displayed', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - : [Common.install()]; - try { - if (!this.isCodeSpace) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'prompted', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - promptCancellationPromise - ]); - if (cancelTokenSource.token.isCancellationRequested) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'dismissed', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - return KernelInterpreterDependencyResponse.cancel; - } - if (selection === selectKernel) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'differentKernel', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - }); - return KernelInterpreterDependencyResponse.selectDifferentKernel; - } else if (selection === Common.install()) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'install', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - cancellationPromise - ]); - if (response === InstallerResponse.Installed) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'installed', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - }); - return KernelInterpreterDependencyResponse.ok; - } else if (response === InstallerResponse.Ignore) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'failed', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - } - } - - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'dismissed', - moduleName: productNameForTelemetry, - resourceType, -``` - - -[src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) -```typescript - return KernelInterpreterDependencyResponse.cancel; - } catch (ex) { - traceError(`Failed to install ${productNameForTelemetry}`, ex); - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'error', - moduleName: productNameForTelemetry, - resourceType, -``` - -
-
- DS_INTERNAL.PYTHON_NOT_INSTALLED - -## Description - - -No description provided - -## Properties - -- - action: - | 'displayed' // Message displayed. - | 'dismissed' // user dismissed the message. - | 'download'; - -## Locations Used - -[src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) -```typescript - } - } - private async handleExecutionWithoutPython() { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'displayed' }); - const selection = await this.appShell.showErrorMessage( - DataScience.pythonNotInstalledNonMarkdown(), - { modal: true }, -``` - - -[src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) -```typescript - Common.install() - ); - if (selection === Common.install()) { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); - this.appShell.openUrl('https://www.python.org/downloads'); - } else { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'dismissed' }); -``` - - -[src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) -```typescript - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); - this.appShell.openUrl('https://www.python.org/downloads'); - } else { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'dismissed' }); - } - } -} -``` - -
-
- DS_INTERNAL.RANK_KERNELS_PERF - -## Description - - - - - Total time taken to find a kernel on disc or on a remote machine. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/kernelFinder.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelFinder.base.ts) -```typescript - ) {} - - @traceDecoratorVerbose('Rank Kernels', TraceOptions.BeforeCall | TraceOptions.Arguments) - @captureTelemetry(Telemetry.RankKernelsPerf) - public async rankKernels( - resource: Resource, - notebookMetadata?: nbformat.INotebookMetadata, -``` - -
-
- DS_INTERNAL.RAWKERNEL_CREATING_NOTEBOOK - -## Description - - - - Telemetry send when we create a notebook for a raw kernel or jupyter - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/hostRawNotebookProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/hostRawNotebookProvider.node.ts) -```typescript - return this.rawNotebookSupportedService.isSupported; - } - - @captureTelemetry(Telemetry.RawKernelCreatingNotebook, undefined, true) - public async createNotebook( - resource: Resource, - kernelConnection: KernelConnectionMetadata, -``` - -
-
- DS_INTERNAL.RAWKERNEL_INFO_RESPONSE - -## Description - - - - - After starting a kernel we send a request to get the kernel info. - This tracks the total time taken to get the response back (or wether we timedout). - If we timeout and later we find successful comms for this session, then timeout is too low - or we need more attempts. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - } else { - traceWarning(`Didn't get response for requestKernelInfo after ${stopWatch.elapsedTime}ms.`); - } - sendTelemetryEvent(Telemetry.RawKernelInfoResonse, stopWatch.elapsedTime, { - attempts, - timedout: !gotIoPubMessage.completed - }); -``` - -
-
- DS_INTERNAL.RAWKERNEL_PROCESS_LAUNCH - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/launcher/kernelProcess.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelProcess.node.ts) -```typescript - } - } - - @captureTelemetry(Telemetry.RawKernelProcessLaunch, undefined, true) - public async launch(workingDirectory: string, timeout: number, cancelToken: CancellationToken): Promise { - if (this.launchedOnce) { - throw new Error('Kernel has already been launched.'); -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_CONNECT - -## Description - - - - Raw kernel timing events - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - throw error; - } - } finally { - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionConnect, stopWatch.elapsedTime); - } - - this.connected = true; -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_DISPOSED - -## Description - - - - - This event is sent when a RawSession's `dispose` method is called. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawSession.node.ts) -```typescript - public async dispose() { - // We want to know who called dispose on us - const stacktrace = new Error().stack; - sendTelemetryEvent(Telemetry.RawKernelSessionDisposed, undefined, { stacktrace }); - - // Now actually dispose ourselves - this.isDisposing = true; -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_KERNEL_PROCESS_EXITED - -## Description - - - - - This event is sent when the underlying kernelProcess for a - RawJupyterSession exits. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/launcher/kernelLauncher.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelLauncher.node.ts) -```typescript - - const disposable = kernelProcess.exited( - ({ exitCode, reason }) => { - sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { - exitCode, - exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(reason) - }); -``` - - -[src/kernels/raw/session/rawSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawSession.node.ts) -```typescript - traceError(`Disposing session as kernel process died ExitCode: ${e.exitCode}, Reason: ${e.reason}`); - // Send telemetry so we know why the kernel process exited, - // as this affects our kernel startup success - sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { - exitCode: e.exitCode, - exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(e.reason) - }); -``` - - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - if (session !== this.session) { - return; - } - sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { - exitCode, - exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(reason) - }); -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_NO_IPYKERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/kernelConnector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/kernelConnector.ts) -```typescript - const rawNotebookProvider = serviceContainer.tryGet(IRawNotebookProvider); - const rawLocalKernel = rawNotebookProvider?.isSupported && isLocal; - if (rawLocalKernel && errorContext === 'start') { - sendKernelTelemetryEvent(resource, Telemetry.RawKernelSessionStartNoIpykernel, { - reason: handleResult - }); - } -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_SHUTDOWN - -## Description - - - - - This event is sent when a RawJupyterSession's `shutdownSession` - method is called. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - // We want to know why we got shut down - const stacktrace = new Error().stack; - return super.shutdownSession(session, statusHandler, isRequestToShutdownRestartSession).then(() => { - sendTelemetryEvent(Telemetry.RawKernelSessionShutdown, undefined, { - isRequestToShutdownRestartSession, - stacktrace - }); -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_START - -## Description - - - - Raw kernel single events - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - Cancellation.throwIfCanceled(options.token); - // Only connect our session if we didn't cancel or timeout - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); - traceInfo( - `${DataScience.kernelStarted().format( - getDisplayNameOrNameOfKernelConnection(this.kernelConnectionMetadata) -``` - - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - if (isCancellationError(error) || options.token.isCancellationRequested) { - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, - error -``` - - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - } else if (error instanceof TimedOutError) { - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, - error -``` - - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - // Send our telemetry event with the error included - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_START_EXCEPTION - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - ); - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStartException, - undefined, - undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_START_SUCCESS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - newSession = await this.startRawSession(options); - Cancellation.throwIfCanceled(options.token); - // Only connect our session if we didn't cancel or timeout - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); - traceInfo( - `${DataScience.kernelStarted().format( -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_START_TIMEOUT - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - undefined, - error - ); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartTimeout); - traceError('Raw session failed to start in given timeout'); - throw error; - } else { -``` - -
-
- DS_INTERNAL.RAWKERNEL_SESSION_START_USER_CANCEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - undefined, - error - ); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartUserCancel); - traceVerbose('Starting of raw session cancelled by user'); - throw error; - } else if (error instanceof TimedOutError) { -``` - -
-
- DS_INTERNAL.RAWKERNEL_START_RAW_SESSION - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) -```typescript - return this.startRawSession({ token: cancelToken, ui: new DisplayOptions(disableUI) }); - } - - @captureTelemetry(Telemetry.RawKernelStartRawSession, undefined, true) - private async startRawSession(options: { token: CancellationToken; ui: IDisplayOptions }): Promise { - if ( - this.kernelConnectionMetadata.kind !== 'startUsingLocalKernelSpec' && -``` - -
-
- DS_INTERNAL.REGISTER_AND_USE_INTERPRETER_AS_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) -```typescript - ); - } - - sendTelemetryEvent(Telemetry.RegisterAndUseInterpreterAsKernel); - return kernelSpecFilePath.fsPath; - } - private async updateKernelEnvironment( -``` - -
-
- DS_INTERNAL.REMOTE_KERNEL_SPEC_COUNT - -## Description - - -No description provided - -## Properties - -- - /** - * Number of kernel specs. - */ - count: number; - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.RESTART_JUPYTER_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) -```typescript - } - - @captureTelemetry(Telemetry.RestartKernel) - @captureTelemetry(Telemetry.RestartJupyterTime) - private async restartExecution(session: IJupyterSession): Promise { - // Just use the internal session. Pending cells should have been canceled by the caller - await session.restart(); -``` - -
-
- DS_INTERNAL.RESTART_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) -```typescript - }); - } - - @captureTelemetry(Telemetry.RestartKernel) - @captureTelemetry(Telemetry.RestartJupyterTime) - private async restartExecution(session: IJupyterSession): Promise { - // Just use the internal session. Pending cells should have been canceled by the caller -``` - -
-
- DS_INTERNAL.RUNTEST - -## Description - - -No description provided - -## Properties - -- - testName: string; -- - testResult: string; -- - perfWarmup?: 'true'; -- - commitHash?: string; -- - timedCheckpoints?: string; - -## Locations Used - -[src/test/testHooks.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/testHooks.node.ts) -```typescript - dimensions = { ...dimensions, commitHash: process.env.GIT_SHA }; - } - - traceInfoIfCI(`Sending telemetry event ${Telemetry.RunTest} with dimensions ${dimensions}`); - telemetryReporter.sendDangerousTelemetryEvent(Telemetry.RunTest, dimensions, measures); - }, - afterAll: async () => { -``` - - -[src/test/testHooks.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/testHooks.node.ts) -```typescript - } - - traceInfoIfCI(`Sending telemetry event ${Telemetry.RunTest} with dimensions ${dimensions}`); - telemetryReporter.sendDangerousTelemetryEvent(Telemetry.RunTest, dimensions, measures); - }, - afterAll: async () => { - if (!IS_CI_SERVER) { -``` - -
-
- DS_INTERNAL.SELECT_JUPYTER_INTERPRETER - -## Description - - -No description provided - -## Properties - -- - /** - * The result of the selection. - * notSelected - No interpreter was selected. - * selected - An interpreter was selected (and configured to have jupyter and notebook). - * installationCancelled - Installation of jupyter and/or notebook was cancelled for an interpreter. - * - * @type {('notSelected' | 'selected' | 'installationCancelled')} - */ - result?: 'notSelected' | 'selected' | 'installationCancelled'; - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts) -```typescript - public async selectInterpreter(): Promise { - const interpreter = await this.jupyterInterpreterSelector.selectInterpreter(); - if (!interpreter) { - sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'notSelected' }); - return; - } - -``` - - -[src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts) -```typescript - return interpreter; - } - case JupyterInterpreterDependencyResponse.cancel: - sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'installationCancelled' }); - return; - default: - return this.selectInterpreter(); -``` - - -[src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts) -```typescript - this._selectedInterpreter = interpreter; - this._onDidChangeInterpreter.fire(interpreter); - this.interpreterSelectionState.updateSelectedPythonPath(interpreter.uri); - sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'selected' }); - } - - // For a given python path check if it can run jupyter for us -``` - -
-
- DS_INTERNAL.SELECT_JUPYTER_INTERPRETER_MESSAGE_DISPLAYED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.node.ts) -```typescript - if (!interpreter) { - // Unlikely scenario, user hasn't selected python, python extension will fall over. - // Get user to select something. - sendTelemetryEvent(Telemetry.SelectJupyterInterpreterMessageDisplayed); - return DataScience.selectJupyterInterpreter(); - } - } -``` - -
-
- DS_INTERNAL.SETTINGS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/globalActivation.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/globalActivation.ts) -```typescript - resultSettings[k] = currentValue; - } - } - sendTelemetryEvent(Telemetry.DataScienceSettings, 0, resultSettings); - } - } -} -``` - -
-
- DS_INTERNAL.SHIFTENTER_BANNER_SHOWN - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/shiftEnterBanner.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/shiftEnterBanner.ts) -```typescript - return; - } - - sendTelemetryEvent(Telemetry.ShiftEnterBannerShown); - const response = await this.appShell.showInformationMessage(this.bannerMessage, ...this.bannerLabels); - switch (response) { - case this.bannerLabels[InteractiveShiftEnterLabelIndex.Yes]: { -``` - - -[src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) -```typescript - config.verifyAll(); - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.EnableInteractiveShiftEnter - ]); - }); -``` - - -[src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) -```typescript - config.verifyAll(); - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.DisableInteractiveShiftEnter - ]); - }); -``` - -
-
- DS_INTERNAL.SHOW_DATA_NO_PANDAS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) -```typescript - throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); - } - - sendTelemetryEvent(Telemetry.PandasNotInstalled); - await this.installMissingDependencies(interpreter, tokenSource); - } finally { - tokenSource.dispose(); -``` - -
-
- DS_INTERNAL.SHOW_DATA_PANDAS_TOO_OLD - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) -```typescript - if (isVersionOfPandasSupported(pandasVersion)) { - return; - } - sendTelemetryEvent(Telemetry.PandasTooOld); - // Warn user that we cannot start because pandas is too old. - const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`; - throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); -``` - -
-
- DS_INTERNAL.START_EXECUTE_NOTEBOOK_CELL_PERCEIVED_COLD - -## Description - - - - - Time take for jupyter server to be busy from the time user first hit `run` cell until jupyter reports it is busy running a cell. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) -```typescript - sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); - executionPromise - .finally(() => - sendTelemetryEvent(Telemetry.StartExecuteNotebookCellPerceivedCold, stopWatch.elapsedTime) - ) - .catch(noop); - } -``` - -
-
- DS_INTERNAL.START_JUPYTER_PROCESS - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/launcher/notebookStarter.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/notebookStarter.node.ts) -```typescript - } - - // Fire off telemetry for the process being talkable - sendTelemetryEvent(Telemetry.StartJupyterProcess, stopWatch.elapsedTime); - - try { - const port = parseInt(url.parse(connection.baseUrl).port || '0', 10); -``` - -
-
- DS_INTERNAL.START_RAW_FAILED_UI_DISABLED - -## Description - - - - Telemetry sent when starting auto starting Native Notebook kernel fails silently. - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.START_SESSION_FAILED_JUPYTER - -## Description - - - - - Telemetry event sent when starting a session for a local connection failed. - - @type {(undefined | never)} - @memberof IEventNamePropertyMapping - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/common/baseJupyterSession.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/common/baseJupyterSession.ts) -```typescript -export class JupyterSessionStartError extends WrappedError { - constructor(originalException: Error) { - super(originalException.message, originalException); - sendTelemetryEvent(Telemetry.StartSessionFailedJupyter, undefined, undefined, originalException, true); - } -} - -``` - -
-
- DS_INTERNAL.SWITCH_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - default: - // We don't know as its the default kernel on Jupyter server. - } - sendKernelTelemetryEvent(document.uri, Telemetry.SwitchKernel); - // If we have an existing kernel, then we know for a fact the user is changing the kernel. - // Else VSC is just setting a kernel for a notebook after it has opened. - if (existingKernel) { -``` - - -[src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) -```typescript - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.RunFileInteractive); - assertEvent(Telemetry.ExecuteCellPerceivedWarm); - assertEvent(Telemetry.SwitchKernel); - }); -}); - -``` - -
-
- DS_INTERNAL.SWITCH_TO_EXISTING_KERNEL - -## Description - - -No description provided - -## Properties - -- language: string - -## Locations Used - -[src/platform/common/utils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/utils.ts) -```typescript -} - -export function sendNotebookOrKernelLanguageTelemetry( - telemetryEvent: Telemetry.SwitchToExistingKernel | Telemetry.NotebookLanguage, - language?: string -) { - language = getTelemetrySafeLanguage(language); -``` - - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - } - switch (this.connection.kind) { - case 'startUsingPythonInterpreter': - sendNotebookOrKernelLanguageTelemetry(Telemetry.SwitchToExistingKernel, PYTHON_LANGUAGE); - break; - case 'connectToLiveRemoteKernel': - sendNotebookOrKernelLanguageTelemetry( -``` - - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - break; - case 'connectToLiveRemoteKernel': - sendNotebookOrKernelLanguageTelemetry( - Telemetry.SwitchToExistingKernel, - this.connection.kernelModel.language - ); - break; -``` - - -[src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) -```typescript - case 'startUsingLocalKernelSpec': - case 'startUsingRemoteKernelSpec': - sendNotebookOrKernelLanguageTelemetry( - Telemetry.SwitchToExistingKernel, - this.connection.kernelSpec.language - ); - break; -``` - -
-
- DS_INTERNAL.SWITCH_TO_INTERPRETER_AS_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.SYNC_ALL_CELLS - -## Description - - - - Sync events - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.SYNC_SINGLE_CELL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.USE_EXISTING_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.USE_INTERPRETER_AS_KERNEL - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.VARIABLE_EXPLORER_FETCH_TIME - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/variables/jupyterVariables.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/jupyterVariables.ts) -```typescript - } - - // IJupyterVariables implementation - @captureTelemetry(Telemetry.VariableExplorerFetchTime, undefined, true) - public async getVariables(request: IJupyterVariablesRequest, kernel?: IKernel): Promise { - return this.variableHandler.getVariables(request, kernel); - } -``` - -
-
- DS_INTERNAL.VARIABLE_EXPLORER_VARIABLE_COUNT - -## Description - - -No description provided - -## Properties - -- variableCount: number - -## Locations Used - -[src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) -```typescript - const response = await this.variables.getVariables(args, activeNotebook); - - this.postMessage(InteractiveWindowMessages.GetVariablesResponse, response).ignoreErrors(); - sendTelemetryEvent(Telemetry.VariableExplorerVariableCount, undefined, { - variableCount: response.totalCount - }); - } else { -``` - -
-
- DS_INTERNAL.VSCNOTEBOOK_CELL_TRANSLATION_FAILED - -## Description - - -No description provided - -## Properties - -- - isErrorOutput: boolean; - -## Locations Used - -[src/kernels/execution/helpers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/helpers.ts) -```typescript - // Unless we already know its an unknown output type. - const outputType: nbformat.OutputType = - customMetadata?.outputType || (isStream ? 'stream' : 'display_data'); - sendTelemetryEvent(Telemetry.VSCNotebookCellTranslationFailed, undefined, { - isErrorOutput: outputType === 'error' - }); - -``` - -
-
- DS_INTERNAL.WAIT_FOR_IDLE_JUPYTER - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/session/jupyterSession.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/session/jupyterSession.ts) -```typescript - return true; - } - - @captureTelemetry(Telemetry.WaitForIdleJupyter, undefined, true) - public waitForIdle(timeout: number): Promise { - // Wait for idle on this session - return this.waitForIdleOnSession(this.session, timeout); -``` - -
-
- DS_INTERNAL.WEB_FETCH_ERROR - -## Description - - - - - Event sent when trying to talk to a remote server and the browser gives us a generic fetch error - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) -```typescript - } - } else { - if (err.message.includes('Failed to fetch') && this.isWebExtension) { - sendTelemetryEvent(Telemetry.FetchError, undefined, { currentTask: 'connecting' }); - } - await this.errorHandler.handleError( - new RemoteJupyterServerConnectionError(userURI, computeServerId(userURI), err) -``` - -
-
- DS_INTERNAL.WEBVIEW_STARTUP - -## Description - - -No description provided - -## Properties - -- type: string - -## Locations Used - -[src/webviews/extension-side/webviewHost.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/webviewHost.ts) -```typescript - protected webViewRendered() { - if (this.webviewInit && !this.webviewInit.resolved) { - // Send telemetry for startup - sendTelemetryEvent(Telemetry.WebviewStartup, this.startupStopwatch.elapsedTime, { type: this.title }); - - // Resolve our started promise. This means the webpanel is ready to go. - this.webviewInit.resolve(); -``` - -
-
- DS_INTERNAL.WEBVIEW_STYLE_UPDATE - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -Event can be removed. Not referenced anywhere - -
-
- DS_INTERNAL.ZMQ_NATIVE_BINARIES_LOADING - -## Description - - - - - Telemetry event sent when the ZMQ native binaries do work. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawNotebookSupportedService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawNotebookSupportedService.node.ts) -```typescript - try { - require('zeromq'); - traceInfo(`ZMQ install verified.`); - sendTelemetryEvent(Telemetry.ZMQSupported); - this._isSupported = true; - } catch (e) { - traceError(`Exception while attempting zmq :`, e); -``` - -
-
- DS_INTERNAL.ZMQ_NATIVE_BINARIES_NOT_LOADING - -## Description - - - - - Telemetry event sent when the ZMQ native binaries do not work. - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/raw/session/rawNotebookSupportedService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawNotebookSupportedService.node.ts) -```typescript - this._isSupported = true; - } catch (e) { - traceError(`Exception while attempting zmq :`, e); - sendTelemetryEvent(Telemetry.ZMQNotSupported); - this._isSupported = false; - } - -``` - -
-
- ENVFILE_VARIABLE_SUBSTITUTION - -## Description - - - - - Telemetry event sent when substituting Environment variables to calculate value of variables - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/variables/environment.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/variables/environment.node.ts) -```typescript - }); - if (!invalid && replacement !== value) { - value = replacement; - sendTelemetryEvent(EventName.ENVFILE_VARIABLE_SUBSTITUTION); - } - - return value.replace(/\\\$/g, '$'); -``` - -
-
- ENVFILE_WORKSPACE - -## Description - - - - - Telemetry event sent when an environment file is detected in the workspace. - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/envFileTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/envFileTelemetry.node.ts) -```typescript -} - -function sendTelemetry(hasCustomEnvPath: boolean = false) { - sendTelemetryEvent(EventName.ENVFILE_WORKSPACE, undefined, { hasCustomEnvPath }); - - envFileTelemetrySent = true; -} -``` - -
-
- EXTENSION.LOAD - -## Description - - - - - Telemetry event sent with details just after editor loads - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/startupTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/startupTelemetry.ts) -```typescript - await activatedPromise; - durations.totalActivateTime = stopWatch.elapsedTime; - const props = await getActivationTelemetryProps(serviceContainer); - sendTelemetryEvent(EventName.EXTENSION_LOAD, durations, props); - } catch (ex) { - traceError('sendStartupTelemetry() failed.', ex); - } -``` - - -[src/platform/startupTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/startupTelemetry.ts) -```typescript - traceError('getActivationTelemetryProps() failed.', ex); - } - } - sendTelemetryEvent(EventName.EXTENSION_LOAD, durations, props, ex); - } catch (exc2) { - traceError('sendErrorTelemetry() failed.', exc2); - } -``` - - -[src/platform/startupTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/startupTelemetry.ts) -```typescript - -async function getActivationTelemetryProps( - serviceContainer: IServiceContainer -): Promise { - // eslint-disable-next-line - // TODO: Not all of this data is showing up in the database... - // eslint-disable-next-line -``` - -
-
- HASHED_PACKAGE_NAME - -## Description - - - - - Telemetry event sent with details when tracking imports - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.node.ts) -```typescript - // Hash the package name so that we will never accidentally see a - // user's private package name. - const hash = getTelemetrySafeHashedString(packageName); - sendTelemetryEvent(EventName.HASHED_PACKAGE_NAME, undefined, { hashedNamev2: hash }); - } - - private lookForImports(lines: (string | undefined)[]) { -``` - - -[src/test/telemetry/importTracker.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/telemetry/importTracker.unit.test.ts) -```typescript - public static expectHashes(...hashes: string[]) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_PERF); - if (hashes.length > 0) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_NAME); - } - - Reporter.properties.pop(); // HASHED_PACKAGE_PERF -``` - -
-
- HASHED_PACKAGE_PERF - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/telemetry/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.node.ts) -```typescript - } - } - - @captureTelemetry(EventName.HASHED_PACKAGE_PERF) - private checkNotebookDocument(e: NotebookDocument) { - this.pendingChecks.delete(e.uri.fsPath); - const lines = this.getNotebookDocumentLines(e); -``` - - -[src/telemetry/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.node.ts) -```typescript - this.lookForImports(lines); - } - - @captureTelemetry(EventName.HASHED_PACKAGE_PERF) - private checkNotebookCell(e: NotebookCellExecutionStateChangeEvent) { - if (!isJupyterNotebook(e.cell.notebook)) { - return; -``` - - -[src/telemetry/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.node.ts) -```typescript - this.lookForImports(result); - } - - @captureTelemetry(EventName.HASHED_PACKAGE_PERF) - private checkDocument(document: TextDocument) { - this.pendingChecks.delete(document.fileName); - const lines = this.getDocumentLines(document); -``` - - -[src/test/telemetry/importTracker.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/telemetry/importTracker.unit.test.ts) -```typescript - public static measures: {}[] = []; - - public static expectHashes(...hashes: string[]) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_PERF); - if (hashes.length > 0) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_NAME); - } -``` - -
-
- JUPYTER_EXPERIMENTS_OPT_IN_OUT - -## Description - - - - - Telemetry event sent with details when a user has requested to opt it or out of an experiment group - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/experiments/service.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/experiments/service.ts) -```typescript - // so we need to perform these checks and send the corresponding telemetry manually. - switch (this.getOptInOptOutStatus(experiment)) { - case 'optOut': { - sendTelemetryEvent(EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, undefined, { - expNameOptedOutOf: experiment - }); - -``` - - -[src/platform/common/experiments/service.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/experiments/service.ts) -```typescript - } - case 'optIn': { - await this.experimentationService.isCachedFlightEnabled(experiment); - sendTelemetryEvent(EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, undefined, { - expNameOptedInto: experiment - }); - -``` - - -[src/test/common/experiments/service.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/common/experiments/service.unit.test.ts) -```typescript - assert.isTrue(result); - assert.equal(telemetryEvents.length, 1); - assert.deepEqual(telemetryEvents[0], { - eventName: EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, - properties: { expNameOptedInto: experiment } - }); - sinon.assert.calledOnce(isCachedFlightEnabledStub); -``` - - -[src/test/common/experiments/service.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/common/experiments/service.unit.test.ts) -```typescript - assert.isFalse(result); - assert.equal(telemetryEvents.length, 1); - assert.deepEqual(telemetryEvents[0], { - eventName: EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, - properties: { expNameOptedOutOf: experiment } - }); - sinon.assert.notCalled(isCachedFlightEnabledStub); -``` - -
-
- JUPYTER_IS_INSTALLED - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) -```typescript - const minor = parseInt(versionMatch[2], 10); - const frontEndVersion = parseFloat(`${major}.${minor}`); - if (shell) { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - frontEnd, - frontEndVersion, - detection: 'shell', -``` - - -[src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) -```typescript - shellType: shell - }); - } else { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - frontEnd, - frontEndVersion, - detection: 'process' -``` - - -[src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) -```typescript - }); - } - } else { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - failed: true, - reason: 'notInstalled', - frontEnd -``` - - -[src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) -```typescript - }); - } - } catch (ex) { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - failed: true, - reason: 'notInstalled', - frontEnd -``` - -
-
- OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR_EX - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); - } - } catch (e) { - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, undefined, e); - traceError(e); - this.errorHandler.handleError(e).then(noop, noop); - } -``` - -
-
- OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST_EX - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - return this.commandManager.executeCommand('outline.focus'); - } - private async onVariablePanelShowDataViewerRequest(request: IShowDataViewerFromVariablePanel) { - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST); - if ( - this.debugService?.activeDebugSession && - this.variableProvider && -``` - -
-
- OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS_EX - -## Description - - -No description provided - -## Properties - - -No properties for event - - -## Locations Used - -[src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) -```typescript - if (columnSize && (await this.dataViewerChecker.isRequestedColumnSizeAllowed(columnSize))) { - const title: string = `${DataScience.dataExplorerTitle()} - ${jupyterVariable.name}`; - await this.dataViewerFactory.create(jupyterVariableDataProvider, title); - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); - } - } catch (e) { - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, undefined, e); -``` - -
-
- PLATFORM.INFO - -## Description - - - - - Telemetry event sent after fetching the OS version - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/common/platform/platformService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.node.ts) -```typescript - public version?: SemVer; - constructor() { - if (this.osType === OSType.Unknown) { - sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { - failureType: PlatformErrors.FailedToDetermineOS - }); - } -``` - - -[src/platform/common/platform/platformService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.node.ts) -```typescript - try { - const ver = coerce(os.release()); - if (ver) { - sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { - osVersion: `${ver.major}.${ver.minor}.${ver.patch}` - }); - return (this.version = ver); -``` - - -[src/platform/common/platform/platformService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.node.ts) -```typescript - } - throw new Error('Unable to parse version'); - } catch (ex) { - sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { - failureType: PlatformErrors.FailedToParseVersion - }); - return parseVersion(os.release()); -``` - -
-
- PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES - -## Description - - -No description provided - -## Properties - -- - /** - * Carries `true` if environment variables are present, `false` otherwise - * - * @type {boolean} - */ - hasEnvVars?: boolean; -- - /** - * Carries `true` if fetching environment variables failed, `false` otherwise - * - * @type {boolean} - */ - failed?: boolean; -- - /** - * Whether the environment was activated within a terminal or not. - * - * @type {boolean} - */ - activatedInTerminal?: boolean; -- - /** - * Whether the environment was activated by the wrapper class. - * If `true`, this telemetry is sent by the class that wraps the two activation providers . - * - * @type {boolean} - */ - activatedByWrapper?: boolean; - -## Locations Used - -[src/platform/common/process/pythonExecutionFactory.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/pythonExecutionFactory.node.ts) -```typescript - options.allowEnvironmentFetchExceptions - ); - const hasEnvVars = envVars && Object.keys(envVars).length > 0; - sendTelemetryEvent(EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES, undefined, { hasEnvVars }); - if (!hasEnvVars) { - return this.create({ - resource: options.resource, -``` - -
-
- TERMINAL_ENV_VAR_EXTRACTION - -## Description - - - - - Telemetry sent only when we fail to extract the env variables for a shell. - -## Properties - - -No properties for event - - -## Locations Used - -[src/platform/terminals/helper.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/terminals/helper.node.ts) -```typescript - terminal?: Terminal - ): Promise<{ env?: NodeJS.ProcessEnv; shell: TerminalShellType }> { - if (this.platform.osType === OSType.Unknown) { - sendTelemetryEvent(Telemetry.TerminalEnvVariableExtraction, undefined, { - failed: true, - reason: 'unknownOs', - shellType: undefined -``` - - -[src/platform/terminals/helper.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/terminals/helper.node.ts) -```typescript - return { env, shell }; - } catch (ex) { - traceError('Failed to extract environment variables', ex); - sendTelemetryEvent(Telemetry.TerminalEnvVariableExtraction, undefined, { - failed: true, - reason: failureReason, - shellType: shell -``` - -
-
- TERMINAL_SHELL_IDENTIFICATION - -## Description - - - - Telemetry event sent to provide information on whether we have successfully identify the type of shell used. - This information is useful in determining how well we identify shells on users machines. - This impacts extraction of env variables from current shell. - So, the better this works, the better it is for the user. - failed - If true, indicates we have failed to identify the shell. Note this impacts impacts ability to activate environments in the terminal & code. - shellIdentificationSource - How was the shell identified. One of 'terminalName' | 'settings' | 'environment' | 'default' - If terminalName, then this means we identified the type of the shell based on the name of the terminal. - If settings, then this means we identified the type of the shell based on user settings in VS Code. - If environment, then this means we identified the type of the shell based on their environment (env variables, etc). - I.e. their default OS Shell. - If default, then we reverted to OS defaults (cmd on windows, and bash on the rest). - This is the worst case scenario. - I.e. we could not identify the shell at all. - hasCustomShell - If undefined (not set), we didn't check. - If true, user has customzied their shell in VSC Settings. - hasShellInEnv - If undefined (not set), we didn't check. - If true, user has a shell in their environment. - If false, user does not have a shell in their environment. - -## Properties - -- - failed: boolean; -- - reason: 'unknownShell' | undefined; -- - terminalProvided: boolean; -- - shellIdentificationSource: 'terminalName' | 'settings' | 'environment' | 'default' | 'vscode'; -- - hasCustomShell: undefined | boolean; -- - hasShellInEnv: undefined | boolean; - -## Locations Used - -[src/platform/terminals/shellDetector.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/terminals/shellDetector.node.ts) -```typescript - // This information is useful in determining how well we identify shells on users machines. - // This impacts executing code in terminals and activation of environments in terminal. - // So, the better this works, the better it is for the user. - sendTelemetryEvent(Telemetry.TerminalShellIdentification, undefined, telemetryProperties); - traceVerbose(`Shell identified as '${shell}'`); - - // If we could not identify the shell, use the defaults. -``` - -
diff --git a/src/interactive-window/interactiveWindow.ts b/src/interactive-window/interactiveWindow.ts index bb7a559dba9..ca74899dd8c 100644 --- a/src/interactive-window/interactiveWindow.ts +++ b/src/interactive-window/interactiveWindow.ts @@ -45,7 +45,6 @@ import { } from '../kernels/types'; import { INotebookControllerManager } from '../notebooks/types'; import { generateMarkdownFromCodeLines, parseForComments } from '../webviews/webview-side/common'; -import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../telemetry/telemetry'; import { chainable } from '../platform/common/utils/decorators'; import { InteractiveCellResultError } from '../platform/errors/interactiveCellResultError'; import { DataScience } from '../platform/common/utils/localize'; @@ -74,6 +73,7 @@ import { IInteractiveWindowDebuggingManager } from '../kernels/debugger/types'; import { CellExecutionCreator } from '../kernels/execution/cellExecutionCreator'; import { updateNotebookMetadata } from '../kernels/execution/helpers'; import { chainWithPendingUpdates } from '../kernels/execution/notebookUpdater'; +import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../kernels/telemetry/helper'; export class InteractiveWindow implements IInteractiveWindowLoadable { public get onDidChangeViewState(): Event { diff --git a/src/kernels/execution/kernelExecution.ts b/src/kernels/execution/kernelExecution.ts index 6cf216efec7..ce524c39b03 100644 --- a/src/kernels/execution/kernelExecution.ts +++ b/src/kernels/execution/kernelExecution.ts @@ -12,7 +12,8 @@ import { traceInfo, traceInfoIfCI, traceWarning } from '../../platform/logging'; import { IDisposable, IExtensionContext } from '../../platform/common/types'; import { createDeferred, waitForPromise } from '../../platform/common/utils/async'; import { StopWatch } from '../../platform/common/utils/stopWatch'; -import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from '../telemetry/sendKernelTelemetryEvent'; +import { trackKernelResourceInformation } from '../telemetry/helper'; import { captureTelemetry } from '../../telemetry'; import { Telemetry } from '../../webviews/webview-side/common/constants'; import { CellOutputDisplayIdTracker } from './cellDisplayIdTracker'; diff --git a/src/kernels/helpers.node.ts b/src/kernels/helpers.node.ts index 4b9cf1f6e21..ae7812b0917 100644 --- a/src/kernels/helpers.node.ts +++ b/src/kernels/helpers.node.ts @@ -10,7 +10,7 @@ import { traceError, traceVerbose } from '../platform/logging'; import { getDisplayPath } from '../platform/common/platform/fs-paths'; import { IPythonExecutionFactory } from '../platform/common/process/types.node'; import { Resource } from '../platform/common/types'; -import { trackKernelResourceInformation } from '../telemetry/telemetry'; +import { trackKernelResourceInformation } from './telemetry/helper'; import { areInterpreterPathsSame } from '../platform/pythonEnvironments/info/interpreter'; import { sendTelemetryEvent } from '../telemetry'; import { concatMultilineString } from '../webviews/webview-side/common'; diff --git a/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts b/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts index d6329378e9e..86191776c31 100644 --- a/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts +++ b/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts @@ -20,7 +20,7 @@ import { createDeferred, sleep } from '../../../../platform/common/utils/async'; import { DataScience } from '../../../../platform/common/utils/localize'; import { StopWatch } from '../../../../platform/common/utils/stopWatch'; import { SessionDisposedError } from '../../../../platform/errors/sessionDisposedError'; -import { sendKernelTelemetryEvent } from '../../../../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from '../../../telemetry/sendKernelTelemetryEvent'; import { Telemetry } from '../../../../webviews/webview-side/common/constants'; import { KernelConnectionMetadata, diff --git a/src/kernels/jupyter/launcher/notebookProvider.ts b/src/kernels/jupyter/launcher/notebookProvider.ts index c10ffefb340..12e5ae75414 100644 --- a/src/kernels/jupyter/launcher/notebookProvider.ts +++ b/src/kernels/jupyter/launcher/notebookProvider.ts @@ -5,7 +5,7 @@ import { inject, injectable, optional } from 'inversify'; import { IPythonExtensionChecker } from '../../../platform/api/types'; -import { trackKernelResourceInformation, sendKernelTelemetryWhenDone } from '../../../telemetry/telemetry'; +import { trackKernelResourceInformation } from '../../telemetry/helper'; import { Telemetry } from '../../../webviews/webview-side/common/constants'; import { ConnectNotebookProviderOptions, @@ -21,6 +21,7 @@ import { DisplayOptions } from '../../displayOptions'; import { IRawNotebookProvider } from '../../raw/types'; import { IJupyterNotebookProvider } from '../types'; import { ServerConnectionType } from './serverConnectionType'; +import { sendKernelTelemetryWhenDone } from '../../telemetry/sendKernelTelemetryEvent'; @injectable() export class NotebookProvider implements INotebookProvider { diff --git a/src/kernels/kernel.base.ts b/src/kernels/kernel.base.ts index 76d384d43fe..49b50d321e3 100644 --- a/src/kernels/kernel.base.ts +++ b/src/kernels/kernel.base.ts @@ -33,11 +33,11 @@ import { DataScience } from '../platform/common/utils/localize'; import { noop } from '../platform/common/utils/misc'; import { StopWatch } from '../platform/common/utils/stopWatch'; import { JupyterConnectError } from '../platform/errors/jupyterConnectError'; +import { sendKernelTelemetryEvent } from './telemetry/sendKernelTelemetryEvent'; import { - sendKernelTelemetryEvent, initializeInteractiveOrNotebookTelemetryBasedOnUserAction, trackKernelResourceInformation -} from '../telemetry/telemetry'; +} from './telemetry/helper'; import { sendTelemetryEvent } from '../telemetry'; import { concatMultilineString } from '../webviews/webview-side/common'; import { Telemetry, Identifiers, CodeSnippets } from '../webviews/webview-side/common/constants'; diff --git a/src/kernels/kernelCrashMonitor.ts b/src/kernels/kernelCrashMonitor.ts index c2e379ef359..d68e4490854 100644 --- a/src/kernels/kernelCrashMonitor.ts +++ b/src/kernels/kernelCrashMonitor.ts @@ -10,7 +10,7 @@ import { Telemetry } from '../platform/common/constants'; import { IDisposableRegistry } from '../platform/common/types'; import { DataScience } from '../platform/common/utils/localize'; import { noop } from '../platform/common/utils/misc'; -import { sendKernelTelemetryEvent } from '../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from './telemetry/sendKernelTelemetryEvent'; import { endCellAndDisplayErrorsInCell } from './execution/helpers'; import { getDisplayNameOrNameOfKernelConnection } from './helpers'; import { IKernel, IKernelProvider } from './types'; diff --git a/src/kernels/raw/launcher/kernelLauncher.node.ts b/src/kernels/raw/launcher/kernelLauncher.node.ts index d7742a6af82..ff29df0b0c5 100644 --- a/src/kernels/raw/launcher/kernelLauncher.node.ts +++ b/src/kernels/raw/launcher/kernelLauncher.node.ts @@ -34,7 +34,7 @@ import { JupyterPaths } from '../finder/jupyterPaths.node'; import { isTestExecution } from '../../../platform/common/constants'; import { getDisplayPathFromLocalFile } from '../../../platform/common/platform/fs-paths.node'; import { noop } from '../../../platform/common/utils/misc'; -import { sendKernelTelemetryWhenDone } from '../../../telemetry/telemetry'; +import { sendKernelTelemetryWhenDone } from '../../telemetry/sendKernelTelemetryEvent'; const PortFormatString = `kernelLauncherPortStart_{0}.tmp`; // Launches and returns a kernel process given a resource or python interpreter. diff --git a/src/kernels/raw/session/hostRawNotebookProvider.node.ts b/src/kernels/raw/session/hostRawNotebookProvider.node.ts index 8eaa96e05fa..8bbd4398472 100644 --- a/src/kernels/raw/session/hostRawNotebookProvider.node.ts +++ b/src/kernels/raw/session/hostRawNotebookProvider.node.ts @@ -19,7 +19,7 @@ import { } from '../../../platform/common/types'; import { createDeferred } from '../../../platform/common/utils/async'; import { DataScience } from '../../../platform/common/utils/localize'; -import { trackKernelResourceInformation } from '../../../telemetry/telemetry'; +import { trackKernelResourceInformation } from '../../telemetry/helper'; import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../webviews/webview-side/common/constants'; import { isPythonKernelConnection } from '../../helpers'; diff --git a/src/kernels/raw/session/rawJupyterSession.node.ts b/src/kernels/raw/session/rawJupyterSession.node.ts index 7c49a43e09a..8a8b94e7cfb 100644 --- a/src/kernels/raw/session/rawJupyterSession.node.ts +++ b/src/kernels/raw/session/rawJupyterSession.node.ts @@ -17,7 +17,8 @@ import { IDisplayOptions, IDisposable, Resource } from '../../../platform/common import { TimedOutError, createDeferred, sleep } from '../../../platform/common/utils/async'; import { DataScience } from '../../../platform/common/utils/localize'; import { StopWatch } from '../../../platform/common/utils/stopWatch'; -import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../../../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from '../../telemetry/sendKernelTelemetryEvent'; +import { trackKernelResourceInformation } from '../../telemetry/helper'; import { sendTelemetryEvent, captureTelemetry } from '../../../telemetry'; import { Telemetry } from '../../../webviews/webview-side/common/constants'; import { getDisplayNameOrNameOfKernelConnection } from '../../../kernels/helpers'; diff --git a/src/kernels/telemetry/helper.ts b/src/kernels/telemetry/helper.ts new file mode 100644 index 00000000000..39931ddf9eb --- /dev/null +++ b/src/kernels/telemetry/helper.ts @@ -0,0 +1,163 @@ +import { Resource } from '../../platform/common/types'; +import { WorkspaceInterpreterTracker } from '../../telemetry/workspaceInterpreterTracker'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { InterpreterCountTracker } from '../../telemetry/interpreterCountTracker'; +import { getTelemetrySafeHashedString, getTelemetrySafeLanguage } from '../../telemetry/helpers'; +import { getNormalizedInterpreterPath } from '../../platform/pythonEnvironments/info/interpreter'; +import { getResourceType } from '../../platform/common/utils'; +import { getComparisonKey } from '../../platform/vscode-path/resources'; +import { getFilePath } from '../../platform/common/platform/fs-paths'; +import { trackedInfo, pythonEnvironmentsByHash, updatePythonPackages } from '../../telemetry/telemetry'; +import { KernelConnectionMetadata } from '../types'; +import { setSharedProperty } from '../../telemetry'; + +/** + * This information is sent with each telemetry event. + */ +export type ContextualTelemetryProps = { + /** + * Whether we're starting the preferred kernel or not. + * If false, then the user chose a different kernel when starting the notebook. + * Doesn't really apply to Interactive Window, as we always pick the current interpreter. + */ + isPreferredKernel?: boolean; + kernelConnection: KernelConnectionMetadata; + startFailed: boolean; + kernelDied: boolean; + interruptKernel: boolean; + restartKernel: boolean; + kernelSpecCount: number; // Total number of kernel specs in list of kernels. + kernelInterpreterCount: number; // Total number of interpreters in list of kernels + kernelLiveCount: number; // Total number of live kernels in list of kernels. + /** + * When we start local Python kernels, this property indicates whether the interpreter matches the kernel. If not this means we've started the wrong interpreter or the mapping is wrong. + */ + interpreterMatchesKernel: boolean; +}; + +export function trackKernelResourceInformation(resource: Resource, information: Partial) { + if (!resource) { + return; + } + const key = getComparisonKey(resource); + const [currentData, context] = trackedInfo.get(key) || [ + { + resourceType: getResourceType(resource), + resourceHash: resource ? getTelemetrySafeHashedString(resource.toString()) : undefined, + kernelSessionId: getTelemetrySafeHashedString(Date.now().toString()) + }, + { previouslySelectedKernelConnectionId: '' } + ]; + + if (information.restartKernel) { + currentData.kernelSessionId = getTelemetrySafeHashedString(Date.now().toString()); + currentData.interruptCount = 0; + currentData.restartCount = (currentData.restartCount || 0) + 1; + } + if (information.interruptKernel) { + currentData.interruptCount = (currentData.interruptCount || 0) + 1; + } + if (information.startFailed) { + currentData.startFailureCount = (currentData.startFailureCount || 0) + 1; + } + currentData.kernelSpecCount = information.kernelSpecCount || currentData.kernelSpecCount || 0; + currentData.kernelLiveCount = information.kernelLiveCount || currentData.kernelLiveCount || 0; + currentData.kernelInterpreterCount = information.kernelInterpreterCount || currentData.kernelInterpreterCount || 0; + currentData.pythonEnvironmentCount = InterpreterCountTracker.totalNumberOfInterpreters; + + const kernelConnection = information.kernelConnection; + if (kernelConnection) { + const newKernelConnectionId = kernelConnection.id; + // If we have selected a whole new kernel connection for this, + // Then reset some of the data + if (context.previouslySelectedKernelConnectionId !== newKernelConnectionId) { + clearInterruptCounter(resource); + clearRestartCounter(resource); + } + if ( + context.previouslySelectedKernelConnectionId && + context.previouslySelectedKernelConnectionId !== newKernelConnectionId + ) { + currentData.kernelSessionId = getTelemetrySafeHashedString(Date.now().toString()); + currentData.switchKernelCount = (currentData.switchKernelCount || 0) + 1; + } + let language: string | undefined; + switch (kernelConnection.kind) { + case 'connectToLiveRemoteKernel': + language = kernelConnection.kernelModel.language; + break; + case 'startUsingRemoteKernelSpec': + case 'startUsingLocalKernelSpec': + language = kernelConnection.kernelSpec.language; + break; + case 'startUsingPythonInterpreter': + language = PYTHON_LANGUAGE; + break; + default: + break; + } + currentData.kernelLanguage = getTelemetrySafeLanguage(language); + // Keep track of the kernel that was last selected. + context.previouslySelectedKernelConnectionId = kernelConnection.id; + + const interpreter = kernelConnection.interpreter; + if (interpreter) { + currentData.isUsingActiveInterpreter = WorkspaceInterpreterTracker.isActiveWorkspaceInterpreter( + resource, + interpreter + ); + currentData.pythonEnvironmentType = interpreter.envType; + currentData.pythonEnvironmentPath = getTelemetrySafeHashedString( + getFilePath(getNormalizedInterpreterPath(interpreter.uri)) + ); + pythonEnvironmentsByHash.set(currentData.pythonEnvironmentPath, interpreter); + if (interpreter.version) { + const { major, minor, patch } = interpreter.version; + currentData.pythonEnvironmentVersion = `${major}.${minor}.${patch}`; + } else { + currentData.pythonEnvironmentVersion = undefined; + } + + updatePythonPackages(currentData); + } + + currentData.kernelConnectionType = currentData.kernelConnectionType || kernelConnection?.kind; + } else { + context.previouslySelectedKernelConnectionId = ''; + } + + trackedInfo.set(key, [currentData, context]); +} + +/** + * Initializes the Interactive/Notebook telemetry as a result of user action. + */ +export function initializeInteractiveOrNotebookTelemetryBasedOnUserAction( + resourceUri: Resource, + kernelConnection: KernelConnectionMetadata +) { + setSharedProperty('userExecutedCell', 'true'); + trackKernelResourceInformation(resourceUri, { kernelConnection }); +} + +export function clearInterruptCounter(resource: Resource) { + if (!resource) { + return; + } + const key = getComparisonKey(resource); + const currentData = trackedInfo.get(key); + if (currentData) { + currentData[0].interruptCount = 0; + } +} +export function clearRestartCounter(resource: Resource) { + if (!resource) { + return; + } + const key = getComparisonKey(resource); + const currentData = trackedInfo.get(key); + if (currentData) { + currentData[0].restartCount = 0; + currentData[0].startFailureCount = 0; + } +} diff --git a/src/kernels/telemetry/sendKernelTelemetryEvent.ts b/src/kernels/telemetry/sendKernelTelemetryEvent.ts new file mode 100644 index 00000000000..ade145eb3f1 --- /dev/null +++ b/src/kernels/telemetry/sendKernelTelemetryEvent.ts @@ -0,0 +1,148 @@ +import { Resource } from '../../platform/common/types'; +import { IEventNamePropertyMapping } from '../../telemetry/types'; +import { Telemetry } from '../../platform/common/constants'; +import { setSharedProperty, sendTelemetryEvent, waitBeforeSending } from '../../telemetry'; +import { getContextualPropsForTelemetry } from '../../telemetry/telemetry'; +import { clearInterruptCounter, trackKernelResourceInformation } from './helper'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; +import { populateTelemetryWithErrorInfo } from '../../platform/errors'; +import { InterruptResult } from '../types'; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { + if (eventName === Telemetry.NotebookStart) { + let kv: Pick; + const data: undefined | typeof kv[Telemetry.NotebookStart] = properties; + // Check start failed. + if (data && 'failed' in data && data.failed) { + trackKernelResourceInformation(resource, { startFailed: true }); + } + } +} + +/** + * @param {(P[E] & { waitBeforeSending: Promise })} [properties] + * Can optionally contain a property `waitBeforeSending` referencing a promise. + * Which must be awaited before sending the telemetry. + */ + +export function sendKernelTelemetryEvent

( + resource: Resource, + eventName: E, + durationMs?: Record | number, + properties?: P[E] & { waitBeforeSending?: Promise }, + ex?: Error +) { + if (eventName === Telemetry.ExecuteCell) { + setSharedProperty('userExecutedCell', 'true'); + } + + const props = getContextualPropsForTelemetry(resource); + Object.assign(props, properties || {}); + sendTelemetryEvent( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + eventName as any, + durationMs, + props, + ex, + true + ); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + resetData(resource, eventName as any, props); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + incrementStartFailureCount(resource, eventName as any, props); +} + +/** + * Send this & subsequent telemetry only after this promise has been resolved. + * We have a default timeout of 30s. + * @param {P[E]} [properties] + * Can optionally contain a property `waitBeforeSending` referencing a promise. + * Which must be awaited before sending the telemetry. + */ +export function sendKernelTelemetryWhenDone

( + resource: Resource, + eventName: E, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + promise: Promise | Thenable, + stopWatch?: StopWatch, + properties?: P[E] & { [waitBeforeSending]?: Promise } +) { + if (eventName === Telemetry.ExecuteCell) { + setSharedProperty('userExecutedCell', 'true'); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const props: any = properties || {}; + stopWatch = stopWatch ? stopWatch : new StopWatch(); + if (typeof promise.then === 'function') { + // eslint-disable-next-line , @typescript-eslint/no-explicit-any + (promise as Promise) + .then( + (data) => { + const props = getContextualPropsForTelemetry(resource); + Object.assign(props, properties || {}); + sendTelemetryEvent( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + eventName as any, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + stopWatch!.elapsedTime, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + props as any + ); + return data; + // eslint-disable-next-line @typescript-eslint/promise-function-async + }, + (ex) => { + const props = getContextualPropsForTelemetry(resource); + Object.assign(props, properties || {}); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + populateTelemetryWithErrorInfo(props as any, ex); + sendTelemetryEvent( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + eventName as any, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + stopWatch!.elapsedTime, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + props as any, + ex, + true + ); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + incrementStartFailureCount(resource, eventName as any, props); + } + ) + .finally(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + resetData(resource, eventName as any, props); + }); + } +} + +/** + * Some information such as interrupt counters & restart counters need to be reset + * after we have successfully interrupted or restarted a kernel. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function resetData(resource: Resource, eventName: string, properties: any) { + // Once we have successfully interrupted, clear the interrupt counter. + if (eventName === Telemetry.NotebookInterrupt) { + let kv: Pick; + const data: undefined | typeof kv[Telemetry.NotebookInterrupt] = properties; + // Check result to determine if success. + if (data && 'result' in data && data.result === InterruptResult.Success) { + clearInterruptCounter(resource); + } + } + // Once we have successfully restarted, clear the interrupt counter. + if (eventName === Telemetry.NotebookRestart) { + let kv: Pick; + const data: undefined | typeof kv[Telemetry.NotebookRestart] = properties; + // For restart to be successful, we should not have `failed` + const failed = data && 'failed' in data ? data.failed : false; + if (!failed) { + clearInterruptCounter(resource); + } + } +} diff --git a/src/notebooks/controllers/kernelConnector.ts b/src/notebooks/controllers/kernelConnector.ts index 032cd2799e5..de756d2bb2e 100644 --- a/src/notebooks/controllers/kernelConnector.ts +++ b/src/notebooks/controllers/kernelConnector.ts @@ -18,7 +18,7 @@ import { traceVerbose, traceWarning } from '../../platform/logging'; import { Resource, IMemento, GLOBAL_MEMENTO, IDisplayOptions, IDisposable } from '../../platform/common/types'; import { createDeferred, createDeferredFromPromise, Deferred } from '../../platform/common/utils/async'; import { DataScience } from '../../platform/common/utils/localize'; -import { sendKernelTelemetryEvent } from '../../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from '../../kernels/telemetry/sendKernelTelemetryEvent'; import { IServiceContainer } from '../../platform/ioc/types'; import { Telemetry, Commands } from '../../webviews/webview-side/common/constants'; import { clearInstalledIntoInterpreterMemento } from '../../kernels/installer/productInstaller'; diff --git a/src/notebooks/controllers/notebookControllerManager.ts b/src/notebooks/controllers/notebookControllerManager.ts index 722f472d22b..9f7c3d79e58 100644 --- a/src/notebooks/controllers/notebookControllerManager.ts +++ b/src/notebooks/controllers/notebookControllerManager.ts @@ -35,7 +35,7 @@ import { import { noop } from '../../platform/common/utils/misc'; import { StopWatch } from '../../platform/common/utils/stopWatch'; import { sendKernelListTelemetry } from '../telemetry/kernelTelemetry'; -import { trackKernelResourceInformation } from '../../telemetry/telemetry'; +import { trackKernelResourceInformation } from '../../kernels/telemetry/helper'; import { IInterpreterService } from '../../platform/interpreter/contracts'; import { IServiceContainer } from '../../platform/ioc/types'; import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; diff --git a/src/notebooks/controllers/vscodeNotebookController.ts b/src/notebooks/controllers/vscodeNotebookController.ts index 8202fc26c3b..50110b4340f 100644 --- a/src/notebooks/controllers/vscodeNotebookController.ts +++ b/src/notebooks/controllers/vscodeNotebookController.ts @@ -49,10 +49,7 @@ import { import { createDeferred } from '../../platform/common/utils/async'; import { DataScience, Common } from '../../platform/common/utils/localize'; import { noop } from '../../platform/common/utils/misc'; -import { - initializeInteractiveOrNotebookTelemetryBasedOnUserAction, - sendKernelTelemetryEvent -} from '../../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from '../../kernels/telemetry/sendKernelTelemetryEvent'; import { IServiceContainer } from '../../platform/ioc/types'; import { EnvironmentType } from '../../platform/pythonEnvironments/info'; import { Telemetry, Commands } from '../../webviews/webview-side/common/constants'; @@ -95,6 +92,7 @@ import { updateNotebookMetadata } from '../../kernels/execution/helpers'; import { KernelMessage } from '@jupyterlab/services'; +import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../../kernels/telemetry/helper'; export class VSCodeNotebookController implements Disposable, IVSCodeNotebookController { private readonly _onNotebookControllerSelected: EventEmitter<{ diff --git a/src/notebooks/notebookCommandListener.ts b/src/notebooks/notebookCommandListener.ts index 0b94e6bc1cb..3554abb3330 100644 --- a/src/notebooks/notebookCommandListener.ts +++ b/src/notebooks/notebookCommandListener.ts @@ -25,7 +25,7 @@ import { getDisplayPath } from '../platform/common/platform/fs-paths'; import { DataScience } from '../platform/common/utils/localize'; import { traceInfoIfCI, traceInfo } from '../platform/logging'; import { sendTelemetryEvent } from '../telemetry'; -import { trackKernelResourceInformation } from '../telemetry/telemetry'; +import { trackKernelResourceInformation } from '../kernels/telemetry/helper'; import { INotebookControllerManager, INotebookEditorProvider } from './types'; import { IDataScienceErrorHandler } from '../platform/errors/types'; import { IServiceContainer } from '../platform/ioc/types'; diff --git a/src/notebooks/telemetry/interpreterPackageTracker.ts b/src/notebooks/telemetry/interpreterPackageTracker.ts index 91e002e8d7b..406270b7a4c 100644 --- a/src/notebooks/telemetry/interpreterPackageTracker.ts +++ b/src/notebooks/telemetry/interpreterPackageTracker.ts @@ -11,7 +11,7 @@ import { IInterpreterService } from '../../platform/interpreter/contracts'; import { INotebookControllerManager } from '../types'; import { IInstaller, Product } from '../../kernels/installer/types'; import { IVSCodeNotebookController } from '../controllers/types'; -import { trackKernelResourceInformation } from '../../telemetry/telemetry'; +import { trackKernelResourceInformation } from '../../kernels/telemetry/helper'; import { IInterpreterPackages } from '../../telemetry/types'; @injectable() diff --git a/src/notebooks/telemetry/kernelTelemetry.ts b/src/notebooks/telemetry/kernelTelemetry.ts index 6c21c6d25a9..2b3e6ab180f 100644 --- a/src/notebooks/telemetry/kernelTelemetry.ts +++ b/src/notebooks/telemetry/kernelTelemetry.ts @@ -6,7 +6,8 @@ import { StopWatch } from '../../platform/common/utils/stopWatch'; import { EnvironmentType } from '../../platform/pythonEnvironments/info'; import { KernelConnectionMetadata } from '../../kernels/types'; import { Telemetry } from '../../platform/common/constants'; -import { sendKernelTelemetryEvent, trackKernelResourceInformation } from '../../telemetry/telemetry'; +import { sendKernelTelemetryEvent } from '../../kernels/telemetry/sendKernelTelemetryEvent'; +import { trackKernelResourceInformation } from '../../kernels/telemetry/helper'; import { ResourceSet } from '../../platform/vscode-path/map'; export function sendKernelListTelemetry( diff --git a/src/platform/startupTelemetry.ts b/src/platform/startupTelemetry.ts index 4f239515bd7..a9fa580c57b 100644 --- a/src/platform/startupTelemetry.ts +++ b/src/platform/startupTelemetry.ts @@ -5,8 +5,9 @@ import { IWorkspaceService } from './common/application/types'; import { isTestExecution } from './common/constants'; import { traceError } from './logging'; import { IServiceContainer } from './ioc/types'; -import { IEventNamePropertyMapping, sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../telemetry'; import { EventName } from '../telemetry/constants'; +import { IEventNamePropertyMapping } from '../telemetry/types'; interface IStopWatch { elapsedTime: number; diff --git a/src/telemetry/telemetry.ts b/src/telemetry/telemetry.ts index a59a806a859..c9b5aed5bfa 100644 --- a/src/telemetry/telemetry.ts +++ b/src/telemetry/telemetry.ts @@ -4,267 +4,32 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports import cloneDeep = require('lodash/cloneDeep'); import { Uri } from 'vscode'; -import { InterruptResult, KernelConnectionMetadata } from '../kernels/types'; import { Resource } from '../platform/common/types'; -import { StopWatch } from '../platform/common/utils/stopWatch'; import { IInterpreterPackages, ResourceSpecificTelemetryProperties } from './types'; -import { WorkspaceInterpreterTracker } from './workspaceInterpreterTracker'; -import { PYTHON_LANGUAGE, Telemetry } from '../platform/common/constants'; -import { InterpreterCountTracker } from './interpreterCountTracker'; -import { getTelemetrySafeHashedString, getTelemetrySafeLanguage } from './helpers'; +import { getTelemetrySafeHashedString } from './helpers'; import { PythonEnvironment } from '../platform/pythonEnvironments/info'; import { createDeferred } from '../platform/common/utils/async'; -import { getNormalizedInterpreterPath } from '../platform/pythonEnvironments/info/interpreter'; import { getResourceType } from '../platform/common/utils'; -import { populateTelemetryWithErrorInfo } from '../platform/errors'; -import { setSharedProperty, IEventNamePropertyMapping, sendTelemetryEvent, waitBeforeSending } from '.'; import { IServiceContainer } from '../platform/ioc/types'; import { getComparisonKey } from '../platform/vscode-path/resources'; -import { getFilePath } from '../platform/common/platform/fs-paths'; - -/** - * This information is sent with each telemetry event. - */ -type ContextualTelemetryProps = { - /** - * Whether we're starting the preferred kernel or not. - * If false, then the user chose a different kernel when starting the notebook. - * Doesn't really apply to Interactive Window, as we always pick the current interpreter. - */ - isPreferredKernel?: boolean; - kernelConnection: KernelConnectionMetadata; - startFailed: boolean; - kernelDied: boolean; - interruptKernel: boolean; - restartKernel: boolean; - kernelSpecCount: number; // Total number of kernel specs in list of kernels. - kernelInterpreterCount: number; // Total number of interpreters in list of kernels - kernelLiveCount: number; // Total number of live kernels in list of kernels. - /** - * When we start local Python kernels, this property indicates whether the interpreter matches the kernel. If not this means we've started the wrong interpreter or the mapping is wrong. - */ - interpreterMatchesKernel: boolean; -}; type Context = { previouslySelectedKernelConnectionId: string; }; -const trackedInfo = new Map(); -const pythonEnvironmentsByHash = new Map(); +export const trackedInfo = new Map(); +export const pythonEnvironmentsByHash = new Map(); let globalContainer: IServiceContainer | undefined = undefined; export function initializeGlobals(serviceContainer: IServiceContainer) { globalContainer = serviceContainer; } -/** - * Initializes the Interactive/Notebook telemetry as a result of user action. - */ -export function initializeInteractiveOrNotebookTelemetryBasedOnUserAction( - resourceUri: Resource, - kernelConnection: KernelConnectionMetadata -) { - setSharedProperty('userExecutedCell', 'true'); - trackKernelResourceInformation(resourceUri, { kernelConnection }); -} -/** - * @param {(P[E] & { waitBeforeSending: Promise })} [properties] - * Can optionally contain a property `waitBeforeSending` referencing a promise. - * Which must be awaited before sending the telemetry. - */ -export function sendKernelTelemetryEvent

( - resource: Resource, - eventName: E, - durationMs?: Record | number, - properties?: P[E] & { waitBeforeSending?: Promise }, - ex?: Error -) { - if (eventName === Telemetry.ExecuteCell) { - setSharedProperty('userExecutedCell', 'true'); - } - - const props = getContextualPropsForTelemetry(resource); - Object.assign(props, properties || {}); - sendTelemetryEvent( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - eventName as any, - durationMs, - props, - ex, - true - ); - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - resetData(resource, eventName as any, props); - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - incrementStartFailureCount(resource, eventName as any, props); -} - -/** - * Send this & subsequent telemetry only after this promise has been resolved. - * We have a default timeout of 30s. - * @param {P[E]} [properties] - * Can optionally contain a property `waitBeforeSending` referencing a promise. - * Which must be awaited before sending the telemetry. - */ -export function sendKernelTelemetryWhenDone

( - resource: Resource, - eventName: E, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - promise: Promise | Thenable, - stopWatch?: StopWatch, - properties?: P[E] & { [waitBeforeSending]?: Promise } -) { - if (eventName === Telemetry.ExecuteCell) { - setSharedProperty('userExecutedCell', 'true'); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const props: any = properties || {}; - stopWatch = stopWatch ? stopWatch : new StopWatch(); - if (typeof promise.then === 'function') { - // eslint-disable-next-line , @typescript-eslint/no-explicit-any - (promise as Promise) - .then( - (data) => { - const props = getContextualPropsForTelemetry(resource); - Object.assign(props, properties || {}); - sendTelemetryEvent( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - eventName as any, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - stopWatch!.elapsedTime, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - props as any - ); - return data; - // eslint-disable-next-line @typescript-eslint/promise-function-async - }, - (ex) => { - const props = getContextualPropsForTelemetry(resource); - Object.assign(props, properties || {}); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - populateTelemetryWithErrorInfo(props as any, ex); - sendTelemetryEvent( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - eventName as any, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - stopWatch!.elapsedTime, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - props as any, - ex, - true - ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - incrementStartFailureCount(resource, eventName as any, props); - } - ) - .finally(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - resetData(resource, eventName as any, props); - }); - } -} -export function trackKernelResourceInformation(resource: Resource, information: Partial) { - if (!resource) { - return; - } - const key = getComparisonKey(resource); - const [currentData, context] = trackedInfo.get(key) || [ - { - resourceType: getResourceType(resource), - resourceHash: resource ? getTelemetrySafeHashedString(resource.toString()) : undefined, - kernelSessionId: getTelemetrySafeHashedString(Date.now().toString()) - }, - { previouslySelectedKernelConnectionId: '' } - ]; - - if (information.restartKernel) { - currentData.kernelSessionId = getTelemetrySafeHashedString(Date.now().toString()); - currentData.interruptCount = 0; - currentData.restartCount = (currentData.restartCount || 0) + 1; - } - if (information.interruptKernel) { - currentData.interruptCount = (currentData.interruptCount || 0) + 1; - } - if (information.startFailed) { - currentData.startFailureCount = (currentData.startFailureCount || 0) + 1; - } - currentData.kernelSpecCount = information.kernelSpecCount || currentData.kernelSpecCount || 0; - currentData.kernelLiveCount = information.kernelLiveCount || currentData.kernelLiveCount || 0; - currentData.kernelInterpreterCount = information.kernelInterpreterCount || currentData.kernelInterpreterCount || 0; - currentData.pythonEnvironmentCount = InterpreterCountTracker.totalNumberOfInterpreters; - - const kernelConnection = information.kernelConnection; - if (kernelConnection) { - const newKernelConnectionId = kernelConnection.id; - // If we have selected a whole new kernel connection for this, - // Then reset some of the data - if (context.previouslySelectedKernelConnectionId !== newKernelConnectionId) { - clearInterruptCounter(resource); - clearRestartCounter(resource); - } - if ( - context.previouslySelectedKernelConnectionId && - context.previouslySelectedKernelConnectionId !== newKernelConnectionId - ) { - currentData.kernelSessionId = getTelemetrySafeHashedString(Date.now().toString()); - currentData.switchKernelCount = (currentData.switchKernelCount || 0) + 1; - } - let language: string | undefined; - switch (kernelConnection.kind) { - case 'connectToLiveRemoteKernel': - language = kernelConnection.kernelModel.language; - break; - case 'startUsingRemoteKernelSpec': - case 'startUsingLocalKernelSpec': - language = kernelConnection.kernelSpec.language; - break; - case 'startUsingPythonInterpreter': - language = PYTHON_LANGUAGE; - break; - default: - break; - } - currentData.kernelLanguage = getTelemetrySafeLanguage(language); - // Keep track of the kernel that was last selected. - context.previouslySelectedKernelConnectionId = kernelConnection.id; - - const interpreter = kernelConnection.interpreter; - if (interpreter) { - currentData.isUsingActiveInterpreter = WorkspaceInterpreterTracker.isActiveWorkspaceInterpreter( - resource, - interpreter - ); - currentData.pythonEnvironmentType = interpreter.envType; - currentData.pythonEnvironmentPath = getTelemetrySafeHashedString( - getFilePath(getNormalizedInterpreterPath(interpreter.uri)) - ); - pythonEnvironmentsByHash.set(currentData.pythonEnvironmentPath, interpreter); - if (interpreter.version) { - const { major, minor, patch } = interpreter.version; - currentData.pythonEnvironmentVersion = `${major}.${minor}.${patch}`; - } else { - currentData.pythonEnvironmentVersion = undefined; - } - - updatePythonPackages(currentData); - } - - currentData.kernelConnectionType = currentData.kernelConnectionType || kernelConnection?.kind; - } else { - context.previouslySelectedKernelConnectionId = ''; - } - - trackedInfo.set(key, [currentData, context]); -} - /** * The python package information is fetch asynchronously. * Its possible the information is available at a later time. * Use this to update with the latest information (if available) */ -function updatePythonPackages( +export function updatePythonPackages( currentData: ResourceSpecificTelemetryProperties & { waitBeforeSending?: Promise }, clonedCurrentData?: ResourceSpecificTelemetryProperties & { waitBeforeSending?: Promise; @@ -328,7 +93,7 @@ export function deleteTrackedInformation(resource: Uri) { * Always return a clone of the properties. * We will be using a reference of this object elsewhere & adding properties to the object. */ -function getContextualPropsForTelemetry( +export function getContextualPropsForTelemetry( resource: Resource ): ResourceSpecificTelemetryProperties & { waitBeforeSendingTelemetry?: Promise } { if (!resource) { @@ -355,61 +120,3 @@ function getContextualPropsForTelemetry( updatePythonPackages(data[0], clonedData); return clonedData; } -/** - * Some information such as interrupt counters & restart counters need to be reset - * after we have successfully interrupted or restarted a kernel. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function resetData(resource: Resource, eventName: string, properties: any) { - // Once we have successfully interrupted, clear the interrupt counter. - if (eventName === Telemetry.NotebookInterrupt) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookInterrupt] = properties; - // Check result to determine if success. - if (data && 'result' in data && data.result === InterruptResult.Success) { - clearInterruptCounter(resource); - } - } - // Once we have successfully restarted, clear the interrupt counter. - if (eventName === Telemetry.NotebookRestart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookRestart] = properties; - // For restart to be successful, we should not have `failed` - const failed = data && 'failed' in data ? data.failed : false; - if (!failed) { - clearInterruptCounter(resource); - } - } -} -function clearInterruptCounter(resource: Resource) { - if (!resource) { - return; - } - const key = getComparisonKey(resource); - const currentData = trackedInfo.get(key); - if (currentData) { - currentData[0].interruptCount = 0; - } -} -function clearRestartCounter(resource: Resource) { - if (!resource) { - return; - } - const key = getComparisonKey(resource); - const currentData = trackedInfo.get(key); - if (currentData) { - currentData[0].restartCount = 0; - currentData[0].startFailureCount = 0; - } -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { - if (eventName === Telemetry.NotebookStart) { - let kv: Pick; - const data: undefined | typeof kv[Telemetry.NotebookStart] = properties; - // Check start failed. - if (data && 'failed' in data && data.failed) { - trackKernelResourceInformation(resource, { startFailed: true }); - } - } -}