Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/client/datascience/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,10 @@ export enum Telemetry {
RunByLineStart = 'DATASCIENCE.RUN_BY_LINE',
RunByLineStep = 'DATASCIENCE.RUN_BY_LINE_STEP',
RunByLineStop = 'DATASCIENCE.RUN_BY_LINE_STOP',
RunByLineVariableHover = 'DATASCIENCE.RUN_BY_LINE_VARIABLE_HOVER'
RunByLineVariableHover = 'DATASCIENCE.RUN_BY_LINE_VARIABLE_HOVER',
TrustAllNotebooks = 'DATASCIENCE.TRUST_ALL_NOTEBOOKS',
TrustNotebook = 'DATASCIENCE.TRUST_NOTEBOOK',
DoNotTrustNotebook = 'DATASCIENCE.DO_NOT_TRUST_NOTEBOOK'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do we use DATASCIENCE vs DS_INTERNAL?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THe original intent was DATASCIENCE was used for queries used by PMs I think. DS_INTERNAL was stuff we weren't sure we'd need? I can never remember. Ian Huff (@IanMatthewHuff) may remember. He implemented this distinction.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's supposed to be anything that is user triggered / part of a user action was DATASCIENCE. DS_INTERNAL is for things like tracking internal timings. DATASCIENCE is correct here as these are all user actions. The intent was to clarify our MAU numbers to make sure that we were only looking at users who were doing something with the product. For instance, auto starting the server (which can happen just from opening a workspace) was getting users counted in MAU even when they never did anything with our product.

}

export enum NativeKeyboardCommandTelemetry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import '../../common/extensions';
import { IDisposableRegistry, IExperimentService } from '../../common/types';
import { swallowExceptions } from '../../common/utils/decorators';
import { DataScience } from '../../common/utils/localize';
import { Commands } from '../constants';
import { sendTelemetryEvent } from '../../telemetry';
import { Commands, Telemetry } from '../constants';
import { INotebookStorageProvider } from '../interactive-ipynb/notebookStorageProvider';
import { INotebookEditorProvider, ITrustService } from '../types';

Expand Down Expand Up @@ -61,6 +62,7 @@ export class TrustCommandHandler implements IExtensionSingleActivationService {
switch (selection) {
case DataScience.trustAllNotebooks():
commands.executeCommand('workbench.action.openSettings', 'python.dataScience.alwaysTrustNotebooks');
sendTelemetryEvent(Telemetry.TrustAllNotebooks);
Comment thread
joyceerhl marked this conversation as resolved.
Resolved
break;
case DataScience.trustNotebook():
// Update model trust
Expand All @@ -73,6 +75,10 @@ export class TrustCommandHandler implements IExtensionSingleActivationService {
});
const contents = model.getContent();
await this.trustService.trustNotebook(model.file, contents);
sendTelemetryEvent(Telemetry.TrustNotebook);
break;
case DataScience.doNotTrustNotebook():
sendTelemetryEvent(Telemetry.DoNotTrustNotebook);
break;
default:
break;
Expand Down
9 changes: 9 additions & 0 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2192,10 +2192,19 @@ export interface IEventNamePropertyMapping {
[Telemetry.StartPageOpenFileBrowser]: never | undefined;
[Telemetry.StartPageOpenFolder]: never | undefined;
[Telemetry.StartPageOpenWorkspace]: never | undefined;

// Run by line events
[Telemetry.RunByLineStart]: never | undefined;
[Telemetry.RunByLineStep]: never | undefined;
[Telemetry.RunByLineStop]: never | undefined;
[Telemetry.RunByLineVariableHover]: never | undefined;

// Trusted notebooks events
[Telemetry.TrustNotebook]: never | undefined;
[Telemetry.TrustAllNotebooks]: never | undefined;
[Telemetry.DoNotTrustNotebook]: never | undefined;

// Native notebooks events
[VSCodeNativeTelemetry.AddCell]: never | undefined;
[VSCodeNativeTelemetry.DeleteCell]: never | undefined;
[VSCodeNativeTelemetry.MoveCell]: never | undefined;
Expand Down