GithubHelp home page GithubHelp logo

vscode-extension-telemetry's Introduction

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

vscode-extension-telemetry's People

Contributors

alextercete avatar almenon avatar ananyajha avatar chrisdias avatar chrmarti avatar jrieken avatar kieferrm avatar ramya-rao-a avatar sbatten avatar v-dmpr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.