vscode-extension-telemetry
This module provides a consistent way for first-party extensions to report telemetry over Application Insights. The module respects the user's decision about whether or not to send telemetry data.
Follow guide to set up Application Insights in Azure and get your key.
install
npm install vscode-extension-telemetry
usage
const vscode = ;const TelemetryReporter = ; // all events will be prefixed with this event nameconst extensionId = '<your extension unique name>'; // extension version will be reported as a property with each event const extensionVersion = '<your extension version>'; // the application insights key (also known as instrumentation key)const key = '<your key>'; // telemetry reporter let reporter; { ... // create telemetry reporter on extension activation reporter = extensionId extensionVersion key; // ensure it gets property disposed contextsubscriptions; ...} { // This will ensure all pending events get flushed reporter;} ...// send event any time after activationreporter; common properties
common.extnamecommon.extversioncommon.vscodemachineidcommon.vscodesessionidcommon.vscodeversioncommon.oscommon.platformversion

