Analyzing error method telemetry

APPLIES TO: Business Central 2022 release wave 1 and later

When a user gets an error dialog while working in Business Central, a telemetry signal is emitted, which can be logged in an Azure Application Insights resource.

This telemetry data lets you identify and analyze calls to the Error method from AL code and errors raised by the platform. You can also set up alerts in Azure Application Insights to get notified if many users experience errors.

Error dialog displayed

Occurs when an error is sent to the client for display, including errors raised by the AL Error method and by the platform.

General dimensions

DimensionDescription or value
messageError dialog shown: {failureReason}
severityLevel3
user_IdThe user telemetry ID for the user. From the user card, you can use user_Id to identify the user who triggered this telemetry event. Learn more in Assign a telemetry ID to users.

Custom dimensions

DimensionDescription or value
eventIdRT0030
alErrorMessageThe error message, with private information removed.

For calls to Error(String), the error string from AL code is shown only if the string is a Label or TextConst data type. For other nonempty strings, Use ERROR with a text constant to improve telemetry details is shown instead. Substitution values aren't included in the diagnostic text.

Messages from Error(ErrorInfo) are also subject to privacy filtering. 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. A redaction message is shown instead.
alDetailedErrorMessageThe detailed error message, with private information removed.
alEnglishLanguageDiagnosticsMessageThe error message in English, regardless of the user's client language.

This dimension is available in version 22.0 and was backported to version 21.4.
alObjectIdSpecifies the ID of the AL object.
alObjectTypeSpecifies the type of the AL object.
alStackTraceThe stack trace in AL.
clientTypeSpecifies the type of client that opened the session, such as Background or Web. For a list of the client types, see ClientType Option Type.
companyNameThe current company name.
failureReasonDialog 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.

DimensionDescription or value
aadTenantIdThe 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.
componentDynamics 365 Business Central Server
componentVersionThe version number of the component that emits telemetry (see the component dimension)
environmentNameThe name of the tenant environment. This dimension isn't included for Business Central on-premises environments. Learn more in Managing environments.
environmentTypeThe environment type for the tenant, such as Production, Sandbox, Trial. Learn more in Environment types.
extensionNameSpecifies the name of the extension/app.
extensionPublisherSpecifies the publisher of the extension/app.
extensionVersionSpecifies the version of the extension.
extensionIdSpecifies the ID of the extension/app.
telemetrySchemaVersionThe version of the Business Central 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 // Available in version 22.0 and backported to version 21.4.
, alStackTrace = customDimensions.alStackTrace
, failureReason = customDimensions.failureReason

Understanding the error dialog

To effectively help users mitigate any issues they might encounter, we recommend learning about the different parts of the error dialog, including how to interpret the AL stack trace. Learn more in Understanding the error dialog.

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