vscode-extension-telemetry

Github星跟蹤圖

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 = require('vscode');
const TelemetryReporter = require('vscode-extension-telemetry');

// all events will be prefixed with this event name
const 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;

function activate(context: vscode.ExtensionContext) {
   ...
   // create telemetry reporter on extension activation
   reporter = new TelemetryReporter(extensionId, extensionVersion, key);
   // ensure it gets property disposed
   context.subscriptions.push(reporter);
   ...
}

function deactivate() {
  // This will ensure all pending events get flushed
   reporter.dispose();
}

...
// send event any time after activation
reporter.sendTelemetryEvent('sampleEvent', { 'stringProp': 'some string' }, { 'numericMeasure': 123});

common properties

  • common.extname
  • common.extversion
  • common.vscodemachineid
  • common.vscodesessionid
  • common.vscodeversion
  • common.os
  • common.platformversion

License

MIT

主要指標

概覽
名稱與所有者microsoft/vscode-extension-telemetry
主編程語言TypeScript
編程語言TypeScript (語言數: 2)
平台
許可證Other
所有者活动
創建於2016-02-05 23:47:17
推送於2025-03-18 17:17:55
最后一次提交
發布數44
最新版本名稱v0.9.8 (發布於 )
第一版名稱0.3 (發布於 )
用户参与
星數133
關注者數32
派生數53
提交數394
已啟用問題?
問題數105
打開的問題數8
拉請求數98
打開的拉請求數0
關閉的拉請求數13
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?