Socket
Book a DemoInstallSign in
Socket

@vscode/extension-telemetry

Package Overview
Dependencies
Maintainers
8
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vscode/extension-telemetry

A module for Visual Studio Code extensions to report consistent telemetry.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
201K
10.16%
Maintainers
8
Weekly downloads
 
Created

What is @vscode/extension-telemetry?

@vscode/extension-telemetry is an npm package designed to help developers collect telemetry data from their Visual Studio Code extensions. This data can include events, errors, and performance metrics, which can be used to improve the extension's functionality and user experience.

What are @vscode/extension-telemetry's main functionalities?

Initialize Telemetry Reporter

This feature allows you to initialize a telemetry reporter with your extension's ID, version, and an Application Insights key. This setup is necessary to start collecting telemetry data.

const TelemetryReporter = require('@vscode/extension-telemetry');
const reporter = new TelemetryReporter(extensionId, extensionVersion, aiKey);

Send Telemetry Event

This feature allows you to send a telemetry event with optional properties and measurements. It helps track specific actions or occurrences within your extension.

reporter.sendTelemetryEvent('eventName', { property1: 'value1' }, { metric1: 100 });

Send Telemetry Error

This feature allows you to send error events, which can include additional properties and metrics. It is useful for tracking and diagnosing errors that occur in your extension.

reporter.sendTelemetryErrorEvent('errorName', { errorProperty: 'value' }, { errorMetric: 1 });

Dispose Telemetry Reporter

This feature ensures that all pending telemetry data is sent before the reporter is disposed of. It is important to call this method when your extension is deactivated to ensure no data is lost.

reporter.dispose();

Other packages similar to @vscode/extension-telemetry

FAQs

Package last updated on 07 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts