Skip to main content

Interface: 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.

Methods

flush()?

optional flush(): void | Promise<void>

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

Returns

void | Promise<void>

Defined in

packages/extension-api/src/extension-api.d.ts:4242


sendErrorData()

sendErrorData(error, data?): void

Function to send an error. Used within a TelemetryLogger

Parameters

error: Error

The error being logged

data?: Record<string, any>

Any additional data to be collected with the exception

Returns

void

Defined in

packages/extension-api/src/extension-api.d.ts:4236


sendEventData()

sendEventData(eventName, data?): void

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

Parameters

eventName: string

The name of the event which you are logging

data?: Record<string, any>

A serializable key value pair that is being logged

Returns

void

Defined in

packages/extension-api/src/extension-api.d.ts:4227