@fluidframework/app-insights-logger Package

Packages > @fluidframework/app-insights-logger

This package provides a telemetry logger that will route typical Fluid telemetry to Azure App Insights. Azure App Insights

Interfaces

Interface Alerts Description
CategoryFilter Beta A filter used to match against the category of a telemetry event
FluidAppInsightsLoggerConfig Beta The configuration object for creating the logger via createLogger(client, config).
NamespaceFilter Beta A filter used to match against the namespaces of a telemetry event

Types

TypeAlias Alerts Description
TelemetryEventCategory Beta

The categories FF uses when instrumenting the code.

generic - Informational log event

error - Error log event, ideally 0 of these are logged during a session

performance - Includes duration, and often has _start, _end, or _cancel suffixes for activity tracking

TelemetryFilter Beta

Object used with an FluidAppInsightsLoggerConfig to define a filter with logic for matching it to telemetry events. Filters can include either a category, namespace or both types of filters; a valid filter must have at least one defined. Not definining the categories filter array is the same as providing an array with all possible categories.

Events must satisify the following rules for a telemetry filter:

1. The event must match the requirements of the most specific relevant filter to it. This takes precedence over a more generic filter. The less categories and longer the namespace within a filter, the more specific it is. Definining no categories is equivalant to defining all categories.

2. If a TelemetryFilter specifies both categories and a namespace, the event must match both.

3. If only categories or a namespace is provided, the event should just match the with whatever was defined.

4. If a namespace pattern exception is specified in the TelemetryFilter, the event should not match the exception pattern.

Functions

Function Alerts Return Type Description
createLogger(client, config) Beta ITelemetryBaseLogger

Creates an ITelemetryBaseLogger that routes Fluid telemetry events to Azure App Insights using the App Insights trackEvent API.

The provided ApplicationInsights instance MUST be initialized with client.loadAppInsights(), or else logging will not occur.

Function Details

createLogger

Creates an ITelemetryBaseLogger that routes Fluid telemetry events to Azure App Insights using the App Insights trackEvent API.

The provided ApplicationInsights instance MUST be initialized with client.loadAppInsights(), or else logging will not occur.

This API is provided as a beta preview and may change without notice.

To use, import via @fluidframework/app-insights-logger/beta.

For more information about our API support guarantees, see here .

Signature

export declare function createLogger(client: ApplicationInsights, config?: FluidAppInsightsLoggerConfig): ITelemetryBaseLogger;

Parameters

Parameter Modifiers Type Description
client ApplicationInsights
config optional FluidAppInsightsLoggerConfig

Returns

Return type: ITelemetryBaseLogger