TelemetrySender

The telemetry sender is the contract between a telemetry logger and some telemetry service. Note that extensions must NOT call the methods of their sender directly as the logger provides extra guards and cleaning.

const sender: vscode.TelemetrySender = {...};
const logger = vscode.env.createTelemetryLogger(sender);

// GOOD - uses the logger
logger.logUsage('myEvent', { myData: 'myValue' });

// BAD - uses the sender directly: no data cleansing, ignores user settings, no echoing to the telemetry output channel etc
sender.logEvent('myEvent', { myData: 'myValue' });

Online Documentation

Properties

Link copied to clipboard
abstract var flush: () -> PromiseLike<Void?>??

Optional flush function which will give this sender a chance to send any remaining events as its TelemetryLogger is being disposed

Functions

Link copied to clipboard
abstract fun sendErrorData(error: JsError, data: Record<JsString, *> = definedExternally)

Function to send an error. Used within a TelemetryLogger

Link copied to clipboard
abstract fun sendEventData(eventName: String, data: Record<JsString, *> = definedExternally)

Function to send event data without a stacktrace. Used within a TelemetryLogger