Skip to content

added telemetry to the errorHandler when jupyter is or isn't installed #8305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -202,7 +202,10 @@ export enum Telemetry {
NotebookRunCount = 'DATASCIENCE.NATIVE.NOTEBOOK_RUN_COUNT',
NotebookOpenCount = 'DATASCIENCE.NATIVE.NOTEBOOK_OPEN_COUNT',
NotebookOpenTime = 'DS_INTERNAL.NATIVE.NOTEBOOK_OPEN_TIME',
SessionIdleTimeout = 'DATASCIENCE.JUPYTER_IDLE_TIMEOUT'
SessionIdleTimeout = 'DATASCIENCE.JUPYTER_IDLE_TIMEOUT',
JupyterNotInstalledErrorShown = 'DATASCIENCE.JUPYTER_NOT_INSTALLED_ERROR_SHOWN',
UserInstalledJupyter = 'DATASCIENCE.USER_INSTALLED_JUPYTER',
UserDidNotInstallJupyter = 'DATASCIENCE.USER_DID_NOT_INSTALL_JUPYTER'
}

export enum NativeKeyboardCommandTelemetry {
Expand Down
6 changes: 6 additions & 0 deletions src/client/datascience/errorHandler/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { IInstallationChannelManager } from '../../common/installer/types';
import { ILogger, Product } from '../../common/types';
import * as localize from '../../common/utils/localize';
import { noop } from '../../common/utils/misc';
import { sendTelemetryEvent } from '../../telemetry';
import { Telemetry } from '../constants';
import { JupyterInstallError } from '../jupyter/jupyterInstallError';
import { JupyterSelfCertsError } from '../jupyter/jupyterSelfCertsError';
import { IDataScienceErrorHandler } from '../types';
Expand All @@ -20,6 +22,7 @@ export class DataScienceErrorHandler implements IDataScienceErrorHandler {

public async handleError(err: Error): Promise<void> {
if (err instanceof JupyterInstallError) {
sendTelemetryEvent(Telemetry.JupyterNotInstalledErrorShown);
const response = await this.applicationShell.showInformationMessage(
err.message,
localize.DataScience.jupyterInstall(),
Expand All @@ -33,13 +36,16 @@ export class DataScienceErrorHandler implements IDataScienceErrorHandler {
const product = ProductNames.get(Product.jupyter);

if (installer && product) {
sendTelemetryEvent(Telemetry.UserInstalledJupyter);
installer.installModule(product)
.catch(e => this.applicationShell.showErrorMessage(e.message, localize.DataScience.pythonInteractiveHelpLink()));
} else if (installers[0] && product) {
installers[0].installModule(product)
.catch(e => this.applicationShell.showErrorMessage(e.message, localize.DataScience.pythonInteractiveHelpLink()));
}
}
} else if (response === localize.DataScience.notebookCheckForImportNo()) {
sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter);
} else if (response === err.actionTitle) {
// This is a special error that shows a link to open for more help
this.applicationShell.openUrl(err.action);
Expand Down
7 changes: 5 additions & 2 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,13 +1425,16 @@ export interface IEventNamePropertyMapping {
[Telemetry.RunFileInteractive]: never | undefined;
[Telemetry.RunFromLine]: never | undefined;
[Telemetry.ScrolledToCell]: never | undefined;
[Telemetry.CellCount]: { count: number} ;
[Telemetry.CellCount]: { count: number };
[Telemetry.Save]: never | undefined;
[Telemetry.AutoSaveEnabled]: {enabled: boolean};
[Telemetry.AutoSaveEnabled]: { enabled: boolean };
[Telemetry.SelfCertsMessageClose]: never | undefined;
[Telemetry.SelfCertsMessageEnabled]: never | undefined;
[Telemetry.SelectJupyterURI]: never | undefined;
[Telemetry.SessionIdleTimeout]: never | undefined;
[Telemetry.JupyterNotInstalledErrorShown]: never | undefined;
[Telemetry.UserInstalledJupyter]: never | undefined;
[Telemetry.UserDidNotInstallJupyter]: never | undefined;
[Telemetry.SetJupyterURIToLocal]: never | undefined;
[Telemetry.SetJupyterURIToUserSpecified]: never | undefined;
[Telemetry.ShiftEnterBannerShown]: never | undefined;
Expand Down