Skip to content

Commit 1ca4d48

Browse files
Update ring buffer size recommendation and filter datadog queries (#30511)
1 parent 7489a9e commit 1ca4d48

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

content/en/database_monitoring/guide/sql_extended_events.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ADD EVENT sqlserver.module_end( -- capture stored procedure completions
101101
)
102102
ADD TARGET package0.ring_buffer -- do not change, datadog is only configured to read from ring buffer at this time
103103
WITH (
104-
MAX_MEMORY = 2048 KB, -- do not exceed 2048, values above 2 MB may result in data loss due to SQLServer internals
104+
MAX_MEMORY = 1024 KB, -- do not exceed 1024, values above 1 MB may result in data loss due to SQLServer internals
105105
TRACK_CAUSALITY = ON, -- allows datadog to correlate related events across activity ID
106106
EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS,
107107
MAX_DISPATCH_LATENCY = 30 SECONDS,
@@ -147,7 +147,7 @@ ADD EVENT sqlserver.attention(
147147
)
148148
ADD TARGET package0.ring_buffer -- do not change, datadog is only configured to read from ring buffer at this time
149149
WITH (
150-
MAX_MEMORY = 2048 KB, -- do not change, setting this larger than 2 MB may result in data loss due to SQLServer internals
150+
MAX_MEMORY = 1024 KB, -- do not change, setting this larger than 1 MB may result in data loss due to SQLServer internals
151151
EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS,
152152
MAX_DISPATCH_LATENCY = 30 SECONDS,
153153
STARTUP_STATE = ON
@@ -243,7 +243,7 @@ ADD EVENT sqlserver.module_end( -- capture stored procedure completions
243243
)
244244
ADD TARGET package0.ring_buffer -- do not change, datadog is only configured to read from ring buffer at this time
245245
WITH (
246-
MAX_MEMORY = 2048 KB, -- do not exceed 2048, values above 2 MB may result in data loss due to SQLServer internals
246+
MAX_MEMORY = 1024 KB, -- do not exceed 1024, values above 1 MB may result in data loss due to SQLServer internals
247247
TRACK_CAUSALITY = ON, -- allows datadog to correlate related events across activity ID
248248
EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS,
249249
MAX_DISPATCH_LATENCY = 30 SECONDS,
@@ -289,7 +289,7 @@ ADD EVENT sqlserver.attention(
289289
)
290290
ADD TARGET package0.ring_buffer -- do not change, datadog is only configured to read from ring buffer at this time
291291
WITH (
292-
MAX_MEMORY = 2048 KB, -- do not change, setting this larger than 2 MB may result in data loss due to SQLServer internals
292+
MAX_MEMORY = 1024 KB, -- do not change, setting this larger than 1 MB may result in data loss due to SQLServer internals
293293
EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS,
294294
MAX_DISPATCH_LATENCY = 30 SECONDS,
295295
STARTUP_STATE = ON
@@ -337,10 +337,10 @@ The default query duration threshold is `duration > 1000000` (1 second). Adjust
337337
<div class="alert alert-warning">Setting thresholds too low can result in excessive event collection that affects server performance, event loss due to buffer overflow, and incomplete data, as Datadog only collects the most recent 1000 events per collection interval.</div>
338338

339339
### Memory allocation
340-
- The default value is `MAX_MEMORY = 2048 KB`.
341-
- Do not exceed 2048 KB, as higher values may cause data loss due to [SQL Server internal limitations][3].
342-
- For high-volume servers, keeping this at a maximum of 2048 KB is recommended.
343-
- For lower-traffic servers, a setting of 1024 KB may be sufficient.
340+
- The default value is `MAX_MEMORY = 1024 KB`.
341+
- Do not exceed 1024 KB, as higher values may cause data loss due to [SQL Server internal limitations][3].
342+
- For high-volume servers, keeping this at a maximum of 1024 KB is recommended.
343+
- For lower-traffic servers, a setting of 512 KB may be sufficient.
344344

345345
### Event filtering {#event-filtering}
346346

@@ -351,9 +351,8 @@ To reduce event volume, you can add filters to the `WHERE` clause. For example:
351351
sql_text <> '' AND
352352
duration > 1000000 AND
353353
-- Add custom filters here
354-
database_name = 'YourImportantDB' -- Only track specific databases
355-
-- OR --
356-
username <> 'ReportUser' -- Exclude specific users
354+
database_name = 'YourImportantDB' AND -- Only track specific databases
355+
username <> 'datadog' -- Exclude Datadog Agent queries or specific users
357356
)
358357
```
359358

0 commit comments

Comments
 (0)