Partager via


LiveTelemetryLogger class

Wraps the configured logger for the runtime and ensures that certain mandatory properties are included on outgoing telemetry events.

Constructors

LiveTelemetryLogger(IRuntimeSignaler, LiveShareRuntime)

Creates a new LiveTelemetryLogger instance.

Methods

formatCorrelationId(undefined | string, number)
sendErrorEvent(string, any, Partial<ILiveTelemetryProperties>)

Sends an error event.

sendPerformanceEvent(string, number, any, Partial<ILiveTelemetryProperties>)

Sends a performance telemetry event.

sendTelemetryEvent(string, any, Partial<ILiveTelemetryProperties>)

Sends a generic telemetry event.

Constructor Details

LiveTelemetryLogger(IRuntimeSignaler, LiveShareRuntime)

Creates a new LiveTelemetryLogger instance.

new LiveTelemetryLogger(runtime: IRuntimeSignaler, _liveRuntime: LiveShareRuntime)

Parameters

runtime
IRuntimeSignaler

Containers runtime instance.

_liveRuntime
LiveShareRuntime

Method Details

formatCorrelationId(undefined | string, number)

static function formatCorrelationId(clientId: undefined | string, timestamp: number): string

Parameters

clientId

undefined | string

timestamp

number

Returns

string

sendErrorEvent(string, any, Partial<ILiveTelemetryProperties>)

Sends an error event.

function sendErrorEvent(eventName: string, error?: any, additionalProperties?: Partial<ILiveTelemetryProperties>)

Parameters

eventName

string

Name of the event to send.

error

any

Optional. Error object to send with event.

additionalProperties

Partial<ILiveTelemetryProperties>

Optional. Additional properties to include with event.

sendPerformanceEvent(string, number, any, Partial<ILiveTelemetryProperties>)

Sends a performance telemetry event.

function sendPerformanceEvent(eventName: string, duration: number, error?: any, additionalProperties?: Partial<ILiveTelemetryProperties>)

Parameters

eventName

string

Name of the event to send.

duration

number

The duration of the event in milliseconds.

error

any

Optional. Error object to send with event.

additionalProperties

Partial<ILiveTelemetryProperties>

Optional. Additional properties to include with event.

sendTelemetryEvent(string, any, Partial<ILiveTelemetryProperties>)

Sends a generic telemetry event.

function sendTelemetryEvent(eventName: string, error?: any, additionalProperties?: Partial<ILiveTelemetryProperties>)

Parameters

eventName

string

Name of the event to send.

error

any

Optional. Error object to send with event.

additionalProperties

Partial<ILiveTelemetryProperties>

Optional. Additional properties to include with event.