@fluidframework/telemetry-utils Package

Packages > @fluidframework/telemetry-utils

Classes

List of classes contained in this package or namespace
Class Description
ChildLogger ChildLogger class contains various helper telemetry methods, encoding in one place schemas for various types of Fluid telemetry events. Creates sub-logger that appends properties to all events
DebugLogger Implementation of debug logger
EventEmitterWithErrorHandling Event Emitter helper class Any exceptions thrown by listeners will be caught and raised through "error" event. Any exception thrown by "error" listeners will propagate to the caller.
LoggingError Helper class for error tracking that can be used to log an error in telemetry. The props passed in (and any set directly on the object after the fact) will be logged in accordance with the given TelemetryDataTag, if present.PLEASE take care to properly tag properties set on this object
MultiSinkLogger Multi-sink logger Takes multiple ITelemetryBaseLogger objects (sinks) and logs all events into each sink Implements ITelemetryBaseLogger (through static create() method)
PerformanceEvent Helper class to log performance events
TelemetryLogger TelemetryLogger class contains various helper telemetry methods, encoding in one place schemas for various types of Fluid telemetry events. Creates sub-logger that appends properties to all events
TelemetryUTLogger Logger that is useful for UT It can be used in places where logger instance is required, but events should be not send over.

Enumerations

List of enums contained in this package or namespace
Enumeration Description
TelemetryDataTag Broad classifications to be applied to individual properties as they're prepared to be logged to telemetry. Please do not modify existing entries for backwards compatibility.

Functions

List of functions contained in this package or namespace
Function Description
isTaggedTelemetryPropertyValue(x) Type guard to identify if a particular value (loosely) appears to be a tagged telemetry property
logIfFalse(logger, condition, event) Like assert, but logs only if the condition is false, rather than throwing
raiseConnectedEvent(logger, emitter, connected, clientId)
safeRaiseEvent(emitter, logger, event, args)

Interfaces

List of interfaces contained in this package or namespace
Interface Description
ILoggingError An error object that supports exporting its properties to be logged to telemetry
IPerformanceEventMarkers Describes what events PerformanceEvent should log By default, all events are logged, but client can override this behavior For example, there is rarely a need to record start event, as we really after success / failure tracking, including duration (on success).
ITaggableTelemetryProperties Property bag containing a mix of value literals and wrapped values along with a tag
ITaggedTelemetryPropertyType A property to be logged to telemetry containing both the value and the tag
ITelemetryLoggerPropertyBag
ITelemetryLoggerPropertyBags

Variables

List of variables contained in this package or namespace
Variable Description
connectedEventName
disconnectedEventName
isILoggingError

Enumerations

TelemetryDataTag enum

Broad classifications to be applied to individual properties as they’re prepared to be logged to telemetry. Please do not modify existing entries for backwards compatibility.

Signature:

export declare enum TelemetryDataTag 

Enumeration Members

List of members in use in this enum
Member Value Description
PackageData "PackageData" Data containing terms from code packages that may have been dynamically loaded
UserData "UserData" Personal data of a variety of classifications that pertains to the user

Functions

isTaggedTelemetryPropertyValue

Type guard to identify if a particular value (loosely) appears to be a tagged telemetry property

Signature:

export declare function isTaggedTelemetryPropertyValue(x: any): x is ITaggedTelemetryPropertyType;

Parameters

List of parameters
Parameter Type Description
x any

Returns:

x is ITaggedTelemetryPropertyType

logIfFalse

Like assert, but logs only if the condition is false, rather than throwing

Signature:

export declare function logIfFalse(logger: ITelemetryBaseLogger, condition: any, event: string | ITelemetryGenericEvent): condition is true;

Parameters

List of parameters
Parameter Type Description
logger ITelemetryBaseLogger The logger to log with
condition any The condition to attest too
event string | ITelemetryGenericEvent The string or event to log

Returns:

condition is true

  • The outcome of the condition

raiseConnectedEvent

Signature:

export declare function raiseConnectedEvent(logger: ITelemetryLogger, emitter: EventEmitter, connected: boolean, clientId?: string): void;

Parameters

List of parameters
Parameter Type Description
logger ITelemetryLogger
emitter EventEmitter
connected boolean
clientId string

Returns:

void

safeRaiseEvent

Signature:

export declare function safeRaiseEvent(emitter: EventEmitter, logger: ITelemetryLogger, event: string, ...args: any[]): void;

Parameters

List of parameters
Parameter Type Description
emitter EventEmitter
logger ITelemetryLogger
event string
args any[]

Returns:

void

Variables

connectedEventName

Signature:

connectedEventName = "connected"

disconnectedEventName

Signature:

disconnectedEventName = "disconnected"

isILoggingError

Signature:

isILoggingError: (x: any) => x is ILoggingError