이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

The Deadlock view enables you to explore deadlock events in your SQL Server database. A deadlock occurs when two or more processes are unable to proceed because each is waiting for the other to release resources.

Before you begin

You must configure Database Monitoring for your SQL Server before following the steps in this guide.

Supported databases
SQL Server
Supported deployments
All deployment types. Azure DB is supported for Agent versions 7.64.0 and later.
Supported Agent versions
7.59.0+

Setup

  1. In the SQL Server database instance, create a Datadog Extended Events (XE) session. You can run the session on any database in the instance.

    Note: If the Datadog XE session isn’t created in the database, the Agent still attempts to collect deadlock events from the default SQL Server system health XE session.

  CREATE EVENT SESSION datadog
  ON SERVER
  ADD EVENT sqlserver.xml_deadlock_report
  ADD TARGET package0.ring_buffer
  WITH (
      MAX_MEMORY = 1024 KB,
      EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS,
      MAX_DISPATCH_LATENCY = 30 SECONDS,
      STARTUP_STATE = ON
  );
  GO

  ALTER EVENT SESSION datadog ON SERVER STATE = START;
  GO
  1. In the Datadog Agent, enable deadlocks in sqlserver.d/conf.yaml.
  deadlocks_collection:
      enabled: true
  1. In the SQL Server database, create a Datadog Extended Events (XE) session.
  CREATE EVENT SESSION datadog
  ON database
  ADD EVENT sqlserver.database_xml_deadlock_report
  ADD TARGET package0.ring_buffer
  WITH (
      MAX_MEMORY = 1024 KB,
      EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS,
      MAX_DISPATCH_LATENCY = 30 SECONDS,
      STARTUP_STATE = ON
  );
  GO

  ALTER EVENT SESSION datadog ON DATABASE STATE = START;
  GO
  1. In the Datadog Agent, enable deadlocks in sqlserver.d/conf.yaml.
  deadlocks_collection:
      enabled: true

Exploring deadlock events

To access the deadlock view, navigate to the APM > Database Monitoring > Databases tab, select a SQL Server host, and then click the Deadlocks tab. The deadlock tab displays details about the victim and survivor processes, and includes a link to the deadlock diagram.

Note: Because deadlocks occur infrequently, it’s unlikely that any deadlock information will be visible right away.

Further reading