Skip to content

Commit bbefe43

Browse files
[chore] Clarify behaviour for db.query.parameter.<key> (#2684)
Signed-off-by: martincostello <[email protected]>
1 parent cb10d74 commit bbefe43

File tree

11 files changed

+55
-22
lines changed

11 files changed

+55
-22
lines changed

docs/database/cassandra.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@ then `<key>` SHOULD be the 0-based index.
131131
`db.query.parameter.<key>` SHOULD match
132132
up with the parameterized placeholders present in `db.query.text`.
133133

134+
It is RECOMMENDED to capture the value as provided by the application
135+
without attempting to do any case normalization.
136+
134137
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
135138

136139
Examples:
137140

138141
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
139142
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
140143

141-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
142-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
144+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
145+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
143146

144147
The following attributes can be important for making sampling decisions
145148
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/cosmosdb.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,18 @@ then `<key>` SHOULD be the 0-based index.
235235
`db.query.parameter.<key>` SHOULD match
236236
up with the parameterized placeholders present in `db.query.text`.
237237

238+
It is RECOMMENDED to capture the value as provided by the application
239+
without attempting to do any case normalization.
240+
238241
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
239242

240243
Examples:
241244

242245
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
243246
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
244247

245-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
246-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
248+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
249+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
247250

248251
The following attributes can be important for making sampling decisions
249252
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/database-spans.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,18 @@ then `<key>` SHOULD be the 0-based index.
218218
`db.query.parameter.<key>` SHOULD match
219219
up with the parameterized placeholders present in `db.query.text`.
220220

221+
It is RECOMMENDED to capture the value as provided by the application
222+
without attempting to do any case normalization.
223+
221224
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
222225

223226
Examples:
224227

225228
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
226229
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
227230

228-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
229-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
231+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
232+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
230233

231234
The following attributes can be important for making sampling decisions
232235
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/mariadb.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,18 @@ then `<key>` SHOULD be the 0-based index.
115115
`db.query.parameter.<key>` SHOULD match
116116
up with the parameterized placeholders present in `db.query.text`.
117117

118+
It is RECOMMENDED to capture the value as provided by the application
119+
without attempting to do any case normalization.
120+
118121
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
119122

120123
Examples:
121124

122125
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
123126
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
124127

125-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
126-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
128+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
129+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
127130

128131
The following attributes can be important for making sampling decisions
129132
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/mysql.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,18 @@ then `<key>` SHOULD be the 0-based index.
115115
`db.query.parameter.<key>` SHOULD match
116116
up with the parameterized placeholders present in `db.query.text`.
117117

118+
It is RECOMMENDED to capture the value as provided by the application
119+
without attempting to do any case normalization.
120+
118121
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
119122

120123
Examples:
121124

122125
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
123126
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
124127

125-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
126-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
128+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
129+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
127130

128131
The following attributes can be important for making sampling decisions
129132
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/oracledb.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,18 @@ then `<key>` SHOULD be the 0-based index.
111111
`db.query.parameter.<key>` SHOULD match
112112
up with the parameterized placeholders present in `db.query.text`.
113113

114+
It is RECOMMENDED to capture the value as provided by the application
115+
without attempting to do any case normalization.
116+
114117
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
115118

116119
Examples:
117120

118121
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
119122
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
120123

121-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
122-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
124+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
125+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
123126

124127
The following attributes can be important for making sampling decisions
125128
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/postgresql.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,18 @@ then `<key>` SHOULD be the 0-based index.
123123
`db.query.parameter.<key>` SHOULD match
124124
up with the parameterized placeholders present in `db.query.text`.
125125

126+
It is RECOMMENDED to capture the value as provided by the application
127+
without attempting to do any case normalization.
128+
126129
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
127130

128131
Examples:
129132

130133
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
131134
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
132135

133-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
134-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
136+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
137+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
135138

136139
The following attributes can be important for making sampling decisions
137140
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/sql-server.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,18 @@ then `<key>` SHOULD be the 0-based index.
122122
`db.query.parameter.<key>` SHOULD match
123123
up with the parameterized placeholders present in `db.query.text`.
124124

125+
It is RECOMMENDED to capture the value as provided by the application
126+
without attempting to do any case normalization.
127+
125128
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
126129

127130
Examples:
128131

129132
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
130133
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
131134

132-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
133-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
135+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
136+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
134137

135138
The following attributes can be important for making sampling decisions
136139
and SHOULD be provided **at span creation time** (if provided at all):

docs/database/sql.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,18 @@ then `<key>` SHOULD be the 0-based index.
172172
`db.query.parameter.<key>` SHOULD match
173173
up with the parameterized placeholders present in `db.query.text`.
174174

175+
It is RECOMMENDED to capture the value as provided by the application
176+
without attempting to do any case normalization.
177+
175178
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
176179

177180
Examples:
178181

179182
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
180183
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
181184

182-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
183-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
185+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
186+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
184187

185188
The following attributes can be important for making sampling decisions
186189
and SHOULD be provided **at span creation time** (if provided at all):

docs/registry/attributes/db.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,18 @@ then `<key>` SHOULD be the 0-based index.
7171
`db.query.parameter.<key>` SHOULD match
7272
up with the parameterized placeholders present in `db.query.text`.
7373

74+
It is RECOMMENDED to capture the value as provided by the application
75+
without attempting to do any case normalization.
76+
7477
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
7578

7679
Examples:
7780

7881
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
7982
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
8083

81-
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
82-
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
84+
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
85+
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
8386

8487
**[7] `db.query.summary`:** The query summary describes a class of database queries and is useful
8588
as a grouping key, especially when analyzing telemetry for database

0 commit comments

Comments
 (0)