Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
vscode-extension-telemetry
Advanced tools
A module for first party microsoft extensions to report consistent telemetry.
This module provides a consistent way for 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.
npm install vscode-extension-telemetry
import * as vscode from 'vscode';
import TelemetryReporter from '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 properly disposed. Upon disposal the events will be flushed
context.subscriptions.push(reporter);
}
By default, we use the AppInsights key to detect whether or not the telemetry is first-party. The constructor now takes an optional parameter that will force the reporter to treat telemetry as first-party. This parameter will not override in the false direction.
Use this method for sending general events to App Insights.
// send event any time after activation
reporter.sendTelemetryEvent('sampleEvent', { 'stringProp': 'some string' }, { 'numericMeasure': 123 });
Use this method for diagnostics in App Insights. This method will automatically drop events in certain environments for first party extensions.
// send an error any time after activation
try { ... } catch (error) {
reporter.sendTelemetryException(error, { 'stringProp': 'some string' }, { 'numericMeasure': 123 });
}
Use this method for sending error telemetry as traditional events to App Insights. This method will automatically drop error properties in certain environments for first party extensions. The last parameter is an optional list of case-sensitive properties that should be dropped. If no array is passed, we will drop all properties but still send the event.
// send an error event any time after activation
reporter.sendTelemetryErrorEvent('sampleErrorEvent', { 'stringProp': 'some string', 'stackProp': 'some user stack trace' }, { 'numericMeasure': 123 }, [ 'stackProp' ]);
common.extname
- The extension namecommon.extversion
- The extension versioncommon.vscodemachineid
- A common machine identifier generated by VS Codecommon.vscodesessionid
- A session identifier generated by VS Codecommon.vscodeversion
- The version of VS Code running the extensioncommon.os
- The OS running VS Codecommon.platformversion
- The version of the OS/Platformcommon.product
- What Vs code is hosted in, i.e. desktop, github.dev, codespaces.common.uikind
- Web or Desktop indicating where VS Code is runningcommon.remotename
- A name to identify the type of remote connection. other
indicates a remote connection not from the 3 main extensions (ssh, docker, wsl).FAQs
A module for first party microsoft extensions to report consistent telemetry.
We found that vscode-extension-telemetry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.