diff --git a/content/en/database_monitoring/guide/_index.md b/content/en/database_monitoring/guide/_index.md index afa53bcd84999..8aff99c06f7be 100644 --- a/content/en/database_monitoring/guide/_index.md +++ b/content/en/database_monitoring/guide/_index.md @@ -19,6 +19,7 @@ cascade: {{< whatsnext desc="SQL Server guides:" >}} {{< nextlink href="database_monitoring/guide/sql_alwayson" >}}Exploring SQL Server AlwaysOn Availability Groups{{< /nextlink >}} + {{< nextlink href="database_monitoring/guide/sql_deadlock" >}}Configuring Deadlock Monitoring on SQL Server{{< /nextlink >}} {{< /whatsnext >}} {{< whatsnext desc="PostgreSQL guides:" >}} diff --git a/content/en/database_monitoring/guide/sql_deadlock.md b/content/en/database_monitoring/guide/sql_deadlock.md new file mode 100644 index 0000000000000..b62b8aca6fd83 --- /dev/null +++ b/content/en/database_monitoring/guide/sql_deadlock.md @@ -0,0 +1,70 @@ +--- +title: Configuring Deadlock Monitoring on SQL Server +further_reading: +- link: "/database_monitoring/" + tag: "Documentation" + text: "Database Monitoring" +- link: "/database_monitoring/setup_sql_server/" + tag: "Documentation" + text: "Setting Up SQL Server" +- link: "/database_monitoring/troubleshooting/" + tag: "Documentation" + text: "Troubleshooting Database Monitoring" +--- + +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. +This guide assumes that Database Monitoring has been configured for your [SQL Server][1]. + +## Before you begin + +Supported databases +: SQL Server + +Supported deployments +: All deployment types except Azure DB (Azure Managed Instance is supported) + +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 a default SQL Server XE view. This view writes to the buffer pool, but there's a higher chance of missing events because of a size limitation on the XML queried from it. For more information, see [You may not see the data you expect in Extended Event Ring Buffer Targets][2] on the SQL Server Support Blog. + +```sql + 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 +``` + +2. In the Datadog Agent, enable deadlocks in `sqlserver.d/conf.yaml`. +```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 + +{{< partial name="whats-next/whats-next.html" >}} + +[1]: /database_monitoring/setup_sql_server/ +[2]: https://techcommunity.microsoft.com/blog/sqlserversupport/you-may-not-see-the-data-you-expect-in-extended-event-ring-buffer-targets8230-/315838 diff --git a/content/en/database_monitoring/setup_sql_server/azure.md b/content/en/database_monitoring/setup_sql_server/azure.md index 702c18cf60aae..defd69863a153 100644 --- a/content/en/database_monitoring/setup_sql_server/azure.md +++ b/content/en/database_monitoring/setup_sql_server/azure.md @@ -8,8 +8,9 @@ further_reading: - link: "/database_monitoring/troubleshooting/?tab=sqlserver" tag: "Documentation" text: "Troubleshoot Common Issues" - - +- link: "/database_monitoring/guide/sql_deadlock/" + tag: "Documentation" + text: "Configure Deadlock Monitoring" --- Database Monitoring provides deep visibility into your Microsoft SQL Server databases by exposing query metrics, query samples, explain plans, database states, failovers, and events. diff --git a/content/en/database_monitoring/setup_sql_server/gcsql.md b/content/en/database_monitoring/setup_sql_server/gcsql.md index c731e5eea05fe..b87eb5a94b602 100644 --- a/content/en/database_monitoring/setup_sql_server/gcsql.md +++ b/content/en/database_monitoring/setup_sql_server/gcsql.md @@ -5,8 +5,9 @@ further_reading: - link: "/integrations/sqlserver/" tag: "Documentation" text: "SQL Server Integration" - - +- link: "/database_monitoring/guide/sql_deadlock/" + tag: "Documentation" + text: "Configure Deadlock Monitoring" --- Database Monitoring provides deep visibility into your Microsoft SQL Server databases by exposing query metrics, query samples, explain plans, database states, failovers, and events. diff --git a/content/en/database_monitoring/setup_sql_server/rds.md b/content/en/database_monitoring/setup_sql_server/rds.md index 015ecceb6e4ce..53d0a8cb5fd05 100644 --- a/content/en/database_monitoring/setup_sql_server/rds.md +++ b/content/en/database_monitoring/setup_sql_server/rds.md @@ -8,8 +8,9 @@ further_reading: - link: "/database_monitoring/troubleshooting/?tab=sqlserver" tag: "Documentation" text: "Troubleshoot Common Issues" - - +- link: "/database_monitoring/guide/sql_deadlock/" + tag: "Documentation" + text: "Configure Deadlock Monitoring" --- Database Monitoring provides deep visibility into your Microsoft SQL Server databases by exposing query metrics, query samples, explain plans, database states, failovers, and events. diff --git a/content/en/database_monitoring/setup_sql_server/selfhosted.md b/content/en/database_monitoring/setup_sql_server/selfhosted.md index 117369a71db38..3d72c641f90a3 100644 --- a/content/en/database_monitoring/setup_sql_server/selfhosted.md +++ b/content/en/database_monitoring/setup_sql_server/selfhosted.md @@ -8,6 +8,9 @@ further_reading: - link: "/database_monitoring/troubleshooting/?tab=sqlserver" tag: "Documentation" text: "Troubleshoot Common Issues" +- link: "/database_monitoring/guide/sql_deadlock/" + tag: "Documentation" + text: "Configure Deadlock Monitoring" - link: "https://www.datadoghq.com/blog/migrate-sql-workloads-to-azure-with-datadog/" tag: "Blog" text: "Strategize your Azure migration for SQL workloads with Datadog"