Normalize "IN(?, ?, ...)" substrings in db.statement span attribute to "IN(?)" #10442
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Hello, we're looking to use
db.statement
as an attribute in span metrics to get RED metrics for each queryCurrently, SQL queries using
IN
with a variable number of values will each generate a differentdb.statement
, varying only by the number of?
in theIN
part. That can cause high cardinality span metrics and makes the metrics difficult to analyzeDescribe the solution you'd like
Replace all
IN(...)
statements in SQLdb.statement
s with a constant value likeIN( ? )
Describe alternatives you've considered
Using the otel collector to normalize the query string
Additional context
Let me know if this would need to first be approved as a semantic convention
The text was updated successfully, but these errors were encountered: