Codeunit "Feature Telemetry"

ID 8703
Namespace: System.Telemetry

Provides functionality for emitting telemetry in a universal format. Only system metadata is to be emitted through this codeunit.

Remarks

Every publisher needs to have an implementation of the "Telemetry Logger" interface and a subscriber to "Telemetry Loggers".OnRegisterTelemetryLogger event in one of their apps in order for this codeunit to work as expected (see "System Telemetry Logger" codeunit).

Properties

Name Value
Access Public
InherentEntitlements X
InherentPermissions X

Methods

LogUsage

Sends telemetry about feature usage.

procedure LogUsage(EventId: Text, FeatureName: Text, EventName: Text)

Parameters

Name Type Description
EventId Text

A unique ID of the event.

FeatureName Text

The name of the feature.

EventName Text

The name of the event.

Examples

FeatureTelemetry.LogUsage('0000XYZ', 'Emailing', 'Email sent');

LogUsage

procedure LogUsage(EventId: Text, FeatureName: Text, EventName: Text, CustomDimensions: Dictionary of [Text, Text])

Parameters

Name Type Description
EventId Text
FeatureName Text
EventName Text
CustomDimensions Dictionary of [Text, Text]

LogError

Sends telemetry about errors happening during feature usage.

procedure LogError(EventId: Text, FeatureName: Text, EventName: Text, ErrorText: Text)

Parameters

Name Type Description
EventId Text

A unique ID of the error.

FeatureName Text

The name of the feature.

EventName Text

The name of the event.

ErrorText Text

The text of the error.

Examples

if not Success then FeatureTelemetry.LogError('0000XYZ', 'Retention policies', 'Applying a policy', GetLastErrorText(true));

LogError

Sends telemetry about errors happening during feature usage.

procedure LogError(EventId: Text, FeatureName: Text, EventName: Text, ErrorText: Text, ErrorCallStack: Text)

Parameters

Name Type Description
EventId Text

A unique ID of the error.

FeatureName Text

The name of the feature.

EventName Text

The name of the event.

ErrorText Text

The text of the error.

ErrorCallStack Text

The error call stack.

Examples

if not Success then FeatureTelemetry.LogError('0000XYZ', 'Configuration packages', 'Importing a package', GetLastErrorText(true), GetLastErrorCallStack());

LogError

procedure LogError(EventId: Text, FeatureName: Text, EventName: Text, ErrorText: Text, ErrorCallStack: Text, CustomDimensions: Dictionary of [Text, Text])

Parameters

Name Type Description
EventId Text
FeatureName Text
EventName Text
ErrorText Text
ErrorCallStack Text
CustomDimensions Dictionary of [Text, Text]

LogUptake

Sends telemetry about feature uptake.

procedure LogUptake(EventId: Text, FeatureName: Text, FeatureUptakeStatus: Enum "Feature Uptake Status")

Parameters

Name Type Description
EventId Text

A unique ID of the event.

FeatureName Text

The name of the feature.

FeatureUptakeStatus System.Telemetry."Feature Uptake Status"

The new status of the feature uptake.

Remarks

Expected feature uptake transitions: "Discovered" -> "Set up" -> "Used" (and only in this order; for example, if for a given feature the first status was logged as "Set up", no telemetry will be emitted) Any state -> "Undiscovered" (to reset the feature uptake status)

LogUptake

procedure LogUptake(EventId: Text, FeatureName: Text, FeatureUptakeStatus: Enum "Feature Uptake Status", CustomDimensions: Dictionary of [Text, Text])

Parameters

Name Type Description
EventId Text
FeatureName Text
FeatureUptakeStatus System.Telemetry."Feature Uptake Status"
CustomDimensions Dictionary of [Text, Text]

LogUptake

Sends telemetry about feature uptake.

procedure LogUptake(EventId: Text, FeatureName: Text, FeatureUptakeStatus: Enum "Feature Uptake Status", IsPerUser: Boolean)

Parameters

Name Type Description
EventId Text

A unique ID of the event.

FeatureName Text

The name of the feature.

FeatureUptakeStatus System.Telemetry."Feature Uptake Status"

The new status of the feature uptake.

IsPerUser Boolean

Specifies if the feature is targeted to be uptaken once for the tenant or uptaken individually by different users.

Remarks

Expected feature uptake transitions: "Discovered" -> "Set up" -> "Used" (and only in this order; for example, if for a given feature the first status was logged as "Set up", no telemetry will be emitted) Any state -> "Undiscovered" (to reset the feature uptake status)

LogUptake

procedure LogUptake(EventId: Text, FeatureName: Text, FeatureUptakeStatus: Enum "Feature Uptake Status", IsPerUser: Boolean, CustomDimensions: Dictionary of [Text, Text])

Parameters

Name Type Description
EventId Text
FeatureName Text
FeatureUptakeStatus System.Telemetry."Feature Uptake Status"
IsPerUser Boolean
CustomDimensions Dictionary of [Text, Text]

See also