Analyzing database deadlock telemetry

INTRODUCED IN: Business Central 2022 release wave 1, version 20.0

The database deadlock telemetry gathers information about deadlocks that happen. Deadlocks can prevent users from completing tasks in the Business Central client. A deadlock occurs when two or more processes block each other because each has locked a database resource. SQL Server terminates and rolls back one of the transactions, known as the deadlock victim. Business Central then emits a telemetry signal for the affected session.

As a partner or developer, this telemetry provides several benefits:

  • Makes you aware that there are deadlocks happening.
  • Lets you identify who was the victim in deadlock situations.
  • In some deadlock problems, the process that is the victim and the process that succeeds will change by chance. In these cases, both will be stored in the telemetry resource as different deadlock events.
  • For further monitoring and troubleshooting, this telemetry is complemented by other features like:

Important

The EnableDeadlockMonitoring server setting controls the separate SQL deadlock monitoring feature. It isn't required to collect the RT0028 telemetry event. Learn more in Monitoring SQL Database Deadlocks.

Database deadlock occurred

Occurs when a deadlock occurs.

General dimensions

DimensionDescription or value
messageDatabase deadlock occurred
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
eventIdRT0028
aadTenantIdSpecifies the Microsoft Entra tenant ID used for Microsoft Entra authentication. For on-premises, if you aren't using Microsoft Entra authentication, this value is common.
alObjectIdSpecifies the ID of the AL object that ran the transaction that was victim of the deadlock.
alObjectNameSpecifies the name of the AL object that ran the transaction that was victim of the deadlock.
alObjectTypeSpecifies the type of the AL object that ran the transaction that was victim of the deadlock, such as a page or report.
alStackTraceThe stack trace in AL.
clientTypeSpecifies the type of client that executed the SQL statement, such as Background or WebClient. Learn more in ClientType option type.
companyNameSpecifies the display name of the Business Central company.
componentDynamics 365 Business Central Server
componentVersionSpecifies the version number of the component that emits telemetry (see the component dimension.)
environmentNameSpecifies the name of the tenant environment. Learn more in Managing environments.
environmentTypeSpecifies the environment type for the tenant, such as Production, Sandbox, Trial. Learn more in Environment types.
extensionIdSpecifies the AppID of the extension that was involved in the deadlock.
extensionNameSpecifies the name of the extension that was involved in the deadlock.
extensionVersionSpecifies the version of the extension that was involved in the deadlock.
sessionIdSpecifies the ID of the session that was involved in the deadlock.
sqlServerSessionIdSpecifies the ID of the SQL server session that was the victim of the deadlock.
sqlStatementSpecifies the SQL statement that was executing in the deadlock victim's transaction.
telemetrySchemaVersionSpecifies the version of the Business Central telemetry schema.

Monitoring and Analyzing Telemetry
Database Lock Timeout Telemetry
Enable Sending Telemetry to Application Insights