How to get Deadlock Chain in SQL Server

In the database Explorer table, it shows the occurrence of Deadlocks but how to narrow down to the source and victim queries. There is no option to drill down from the graph.

Based on the currently documented capabilities, the standard Dynatrace Microsoft SQL Server extension does not provide a native drill-down from the Deadlocks graph to identify the victim and other participating SQL queries.

The available sql-server.locks.deadlocks.count metric shows the occurrence and trend of deadlocks at the SQL Server instance level. The current extension does not indicate that the extension collects or exposes the deadlock XML, participating SQL statements, session IDs, or the transaction selected as the victim.

For Dynatrace SaaS, a possible workaround is to use Custom Extensions Creator to create a custom SQL Server query that reads the xml_deadlock_report events from SQL Server’s built-in system_health Extended Events session. The query and output mapping should first be tested and validated in the target environment.

Microsoft documents that the deadlock XML contains:

victim-list: the process selected as the deadlock victim
process-list: all processes involved, including their SQL details
resource-list: the database resources involved in the deadlock

SQL Server deadlock guidance and sample query:

Dynatrace Custom Extensions Creator: