Skip to content

Commit 2b35698

Browse files
authored
Fix sqlserver metric collection row_key (#18882)
* Fix sqlserver metric collection row_key * changelog * lint
1 parent 33c4648 commit 2b35698

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

sqlserver/changelog.d/18882.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update sqlserver metric collection row_key to prevent overwriting metric information for two queries with the same query_plan_hash but part of two different stored procedures.

sqlserver/datadog_checks/sqlserver/statements.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ def _row_key(row):
153153
:param row: a normalized row from STATEMENT_METRICS_QUERY
154154
:return: a tuple uniquely identifying this row
155155
"""
156-
return (
157-
row.get('database_name'),
158-
row['query_signature'],
159-
row['query_hash'],
160-
row['query_plan_hash'],
161-
)
156+
return (row.get('database_name'), row['query_signature'], row['query_hash'], row.get('procedure_name'))
162157

163158

164159
XML_PLAN_OBFUSCATION_ATTRS = frozenset(

0 commit comments

Comments
 (0)