Skip to content

Latest commit

 

History

History
118 lines (92 loc) · 7.53 KB

telemetry-error-method-trace.md

File metadata and controls

118 lines (92 loc) · 7.53 KB
title description author ms.topic ms.devlang ms.search.keywords ms.date ms.author ms.reviewer
Error method trace telemetry
Learn about the Error method telemetry in Business Central
jswymer
conceptual
al
administration, tenant, admin, environment, sandbox, telemetry
12/21/2023
jswymer
jswymer

Analyzing error method telemetry

[!INCLUDE2022_releasewave1.md]

[!INCLUDEazure-ad-to-microsoft-entra-id]

When a user gets an error dialog while working in [!INCLUDEprod_shoirt], a telemetry signal is emitted, which can be logged in an [!INCLUDEappInsights] resource.

This telemetry data let's you identify and analyze calls to the Error method from AL code. You can also set up alerts in [!INCLUDEappInsights] to get notified if many users experience errors.

Error dialog displayed

Occurs when the Error method is called and displays a dialog to the user.

General dimensions

Dimension Description or value
message Error dialog displayed: {failureReason}
severityLevel 3
user_Id [!INCLUDEuser_Id]

Custom dimensions

Dimension Description or value
eventId RT0030
alErrorMessage The error string defined in the error method and displayed in the client.

The actual error string from AL code is shown in this dimension only if the string is a Label or TextConst data type. For all other data types, the string Use ERROR with a text constant to improve telemetry details is shown instead of the actual string.

Some messages can contain customer data. As a precaution, Business Central only emits information that's classified as SystemMetadata. Information that belongs to other data classifications, like customer data, isn't shown. Instead, the following message is shown: "Message not shown because the NavBaseException(string, Exception, bool) constructor was used."
alEnglishLanguageDiagnosticsMessage The error message in English (no matter which language the user had specified in the client).

This dimension was introduced in Business Central 2023 release wave 1, version 22.0.
alObjectId Specifies the ID of the AL object.
alObjectType Specifies the type of the AL object.
alStackTrace [!INCLUDEalStackTrace]
clientType [!INCLUDEclientType]
companyName [!INCLUDEcompanyName]
failureReason Dialog means the error was the result of an error method call in AL. Errors thrown by the platform have other reasons, like MetadataNotFound.

Common custom dimensions

The following table explains other custom dimensions that are common to all error telemetry.

Dimension Description or value
aadTenantId The Microsoft Entra tenant ID that's used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.
component Dynamics 365 Business Central Server
componentVersion The version number of the component that emits telemetry (see the component dimension)
environmentName The name of the tenant environment. See Managing Environments. This dimension isn't included for [!INCLUDEprod_short.md] on-premises environments.
environmentType The environment type for the tenant, such as Production, Sandbox, Trial. See Environment Types
telemetrySchemaVersion The version of the [!INCLUDEprod_short] telemetry schema

Sample KQL code (error dialogs)

This KQL code can help you get started analyzing which error dialogs users see:

traces
| where timestamp > ago(60d) // adjust as needed
| where customDimensions.eventId == 'RT0030'
| project timestamp
// in which environment/company did it happen
, aadTenantId = customDimensions.aadTenantId
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
, companyName = customDimensions.companyName
// in which extension/app
, extensionId = customDimensions.extensionId
, extensionName = customDimensions.extensionName
, extensionVersion = customDimensions.extensionVersion
, extensionPublisher = customDimensions.extensionPublisher
// in which object
, alObjectId = customDimensions.alObjectId
, alObjectName = customDimensions.alObjectName
, alObjectType = customDimensions.alObjectType
// which user got the error
, usertelemetryId = case(
  toint( substring(customDimensions.componentVersion,0,2)) >= 20, user_Id // user telemetry id was introduced in the platform in version 20.0
, 'N/A'
)
// error information
, clientType = customDimensions.clientType
, errorMessageInUsersLanguage = customDimensions.alErrorMessage
, errorMessageInEnglish = customDimensions.alEnglishLanguageDiagnosticsMessage // This dimension was introduced in Business Central 2023 release wave 1, version 21.4.
, alStackTrace = customDimensions.alStackTrace
, failureReason = customDimensions.failureReason

Understanding the error dialog

To effectively help users mitigate any issues they might encounter, you should learn more about the different parts of the error dialog, including how to interpret the AL stack trace. For more information, see Understanding the error dialog.

See also

Dialog.Error Method Dialog.Error Method
Understanding the error dialog
Monitoring and Analyzing Telemetry
Enable Sending Telemetry to Application Insights