r/SQLServer • u/downshiftdata • Feb 23 '26
Question Datadog Config Question
Does anyone know if you can configure Datadog to not strip comments from queries from SQL Server that show up in the Query Metrics view? My pattern with ad hoc inside stored procedures is to prepend it with a comment containing the name of the stored procedure that generated it, and this info is lost by the time I can see it in Datadog.
4
Upvotes
View all comments
Show parent comment
1
u/Black_Magic100 Feb 24 '26
I don't remember exactly how it works, but if you use Datadog DBM (database monitoring) full propagation mode on the client, they actually will inject a comment block at the beginning of the query to match up a query hash to a Service in APM. They also use the old session context, but not sure how the two play together. I imagine it sets the session context on the first roundtrip to the database.
I also am pretty sure that stripping comments is not something that happens in DD like OP suggests.
"SQL query comments may be collected by the Agent and sent to Datadog without passing through obfuscation. SQL query comments generally do not contain sensitive data, but comments extracted from the query SQL will not pass through obfuscation."