Skip to content
Prev Previous commit
Next Next commit
Add telemetry on product install
  • Loading branch information
rchiodo committed Feb 13, 2020
commit 55b75ddf318e299b37499de54ba7c89ca225796d
19 changes: 18 additions & 1 deletion src/client/common/installer/productInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as os from 'os';
import { CancellationToken, OutputChannel, Uri } from 'vscode';
import '../../common/extensions';
import * as localize from '../../common/utils/localize';
import { Telemetry } from '../../datascience/constants';
import { IInterpreterService } from '../../interpreter/contracts';
import { IServiceContainer } from '../../ioc/types';
import { LinterId } from '../../linters/types';
Expand All @@ -27,6 +28,7 @@ import {
ProductType
} from '../types';
import { isResource } from '../utils/misc';
import { StopWatch } from '../utils/stopWatch';
import { ProductNames } from './productNames';
import { IInstallationChannelManager, InterpreterUri, IProductPathService, IProductService } from './types';

Expand Down Expand Up @@ -355,7 +357,22 @@ export class DataScienceInstaller extends BaseInstaller {
'Yes',
'No'
);
return item === 'Yes' ? this.install(product, resource, cancel) : InstallerResponse.Ignore;
if (item === 'Yes') {
const stopWatch = new StopWatch();
try {
const response = await this.install(product, resource, cancel);
const event =
product === Product.jupyter ? Telemetry.UserInstalledJupyter : Telemetry.UserInstalledModule;
sendTelemetryEvent(event, stopWatch.elapsedTime, { product: product.toString() });
return response;
} catch (e) {
if (product === Product.jupyter) {
sendTelemetryEvent(Telemetry.JupyterInstallFailed);

@IanMatthewHuff Ian Huff (IanMatthewHuff) Feb 13, 2020 •

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.

Not relevant in particular to our team. But might be worthwhile just for the extension in general to log telemetry on UserModuleInstallFailed. #WontFix

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.

Dan/Savannah can ask for this if they want it I think. Not sure we should add telemetry unless they want it.


In reply to: 379120268 [](ancestors = 379120268)

}
throw e;
}
}
return InstallerResponse.Ignore;
}
}

Expand Down