vscode-extension-telemetry

  • Version 0.4.5
  • Published
  • 482 kB
  • No dependencies
  • MIT license

Install

npm i vscode-extension-telemetry
yarn add vscode-extension-telemetry
pnpm add vscode-extension-telemetry

Overview

A module for first party microsoft extensions to report consistent telemetry.

Index

Classes

class TelemetryReporter

class TelemetryReporter {}

    constructor

    constructor(
    extensionId: string,
    extensionVersion: string,
    key: string,
    firstParty?: boolean
    );
    • Parameter extensionId

      The id of your extension

      Parameter extensionVersion

      The version of your extension

      Parameter key

      The app insights key

      Parameter firstParty

      Whether or not the telemetry is first party (i.e from Microsoft / GitHub)

    method dispose

    dispose: () => Promise<any>;

      method sendRawTelemetryEvent

      sendRawTelemetryEvent: (
      eventName: string,
      properties?: RawTelemetryEventProperties,
      measurements?: TelemetryEventMeasurements
      ) => void;
      • Sends a raw (unsanitized) telemetry event with the given properties and measurements

        Parameter eventName

        The name of the event

        Parameter properties

        The set of properties to add to the event in the form of a string key value pair

        Parameter measurements

        The set of measurements to add to the event in the form of a string key number value pair

      method sendTelemetryErrorEvent

      sendTelemetryErrorEvent: (
      eventName: string,
      properties?: TelemetryEventProperties,
      measurements?: TelemetryEventMeasurements,
      errorProps?: string[]
      ) => void;
      • Sends a telemetry error event with the given properties, measurements, and errorProps

        Parameter eventName

        The name of the event

        Parameter properties

        The set of properties to add to the event in the form of a string key value pair

        Parameter measurements

        The set of measurements to add to the event in the form of a string key number value pair

        Parameter errorProps

        A list of case sensitive properties to drop, if excluded we drop all properties but still send the event

      method sendTelemetryEvent

      sendTelemetryEvent: (
      eventName: string,
      properties?: TelemetryEventProperties,
      measurements?: TelemetryEventMeasurements
      ) => void;
      • Sends a telemetry event with the given properties and measurements Properties are sanitized on best-effort basis to remove sensitive data prior to sending.

        Parameter eventName

        The name of the event

        Parameter properties

        The set of properties to add to the event in the form of a string key value pair

        Parameter measurements

        The set of measurements to add to the event in the form of a string key number value pair

      method sendTelemetryException

      sendTelemetryException: (
      error: Error,
      properties?: TelemetryEventProperties,
      measurements?: TelemetryEventMeasurements
      ) => void;
      • Sends an exception which includes the error stack, properties, and measurements

        Parameter error

        The error to send

        Parameter properties

        The set of properties to add to the event in the form of a string key value pair

        Parameter measurements

        The set of measurements to add to the event in the form of a string key number value pair

      Interfaces

      interface RawTelemetryEventProperties

      interface RawTelemetryEventProperties {}

        index signature

        readonly [key: string]: any;

          interface TelemetryEventMeasurements

          interface TelemetryEventMeasurements {}

            index signature

            readonly [key: string]: number;

              interface TelemetryEventProperties

              interface TelemetryEventProperties {}

                index signature

                readonly [key: string]: string;

                  Package Files (1)

                  Dependencies (0)

                  No dependencies.

                  Dev Dependencies (9)

                  Peer Dependencies (0)

                  No peer dependencies.

                  Badge

                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/vscode-extension-telemetry.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/vscode-extension-telemetry)
                  • HTML
                    <a href="https://www.jsdocs.io/package/vscode-extension-telemetry"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>