@@ -119,7 +119,12 @@ the `withTransaction` span.
119
119
The span name SHOULD be:
120
120
121
121
- ` driver_operation_name db.collection_name ` if the operation is executed on a collection (e.g.,
122
- ` findOneAndDelete warehouse.users ` ).
122
+ ` collection.findOneAndDelete(filter) ` will report ` findAndModify warehouse_db.users_coll ` ).
123
+
124
+ ** Note** : since the ` findOneAndDelete ` operation is implemented as a ` findAndModify ` command, the operation name in the
125
+ span is ` findAndModify ` . This ensures consistency between drivers when naming operations. See the
126
+ [ covered operations] ( #covered-operations ) table below for mapping of public API methods to operation names.
127
+
123
128
- ` driver_operation_name db ` if there is no specific collection for the operation (e.g., ` runCommand warehouse ` ).
124
129
125
130
##### Operation Span Kind
@@ -143,14 +148,30 @@ requires an operation span to be available throughout the complete operation lif
143
148
144
149
###### db.namespace
145
150
146
- This attribute SHOULD be set to current database name except for operations executing against admin db. This field is
147
- omitted for transaction (abort|commit), and client ` bulkWrite ` operations.
151
+ This attribute SHOULD be set to current database name except for operations executing against admin db ex: (transaction,
152
+ client ` bulkWrite ` ) operations.
153
+
154
+ Examples:
155
+
156
+ - ` find ` on ` test.users ` → ` test `
157
+ - ` runCommand ` on ` admin ` → ` admin `
158
+ - ` commitTransaction ` → ` admin `
159
+ - ` abortTransaction ` → ` admin `
160
+ - client ` bulkWrite ` → ` admin `
148
161
149
162
###### db.collection.name
150
163
151
164
This attribute should be set to the user's collection if the operation is executing against a collection, this field is
152
165
omitted for commands running against ` admin ` database or commands that do not target a specific collection.
153
166
167
+ Examples:
168
+
169
+ - ` find ` on ` test.users ` → ` users `
170
+ - ` runCommand ` on ` admin ` → * omitted*
171
+ - ` commitTransaction ` → * omitted*
172
+ - ` abortTransaction ` → * omitted*
173
+ - client ` bulkWrite ` → * omitted*
174
+
154
175
##### Exceptions
155
176
156
177
If the driver operation fails with an exception, drivers MUST record an exception to the current operation span. When
@@ -204,21 +225,38 @@ applicable to MongoDB.
204
225
205
226
###### db.namespace
206
227
207
- This attribute SHOULD be set to current database name except for commands executing against admin db. This field is
208
- omitted for transaction (abort|commit).
228
+ This attribute SHOULD be set to current database name except for operations executing against admin db ex: (transaction,
229
+ client ` bulkWrite ` ) operations.
230
+
231
+ Examples:
232
+
233
+ - ` find ` on ` test.users ` → ` test `
234
+ - ` runCommand ` on ` admin ` → ` admin `
235
+ - ` commitTransaction ` → ` admin `
236
+ - ` abortTransaction ` → ` admin `
237
+ - client ` bulkWrite ` → ` admin `
209
238
210
239
###### db.collection.name
211
240
212
241
This attribute should be set to the user's collection if the operation is executing against a collection, this field is
213
242
omitted for commands running against ` admin ` database or commands that do not target a specific collection.
214
243
244
+ Examples:
245
+
246
+ - ` find ` on ` test.users ` → ` users `
247
+ - ` runCommand ` on ` admin ` → * omitted*
248
+ - ` commitTransaction ` → * omitted*
249
+ - ` abortTransaction ` → * omitted*
250
+ - client ` bulkWrite ` → * omitted*
251
+
215
252
###### db.query.summary
216
253
217
254
This attribute SHOULD contain:
218
255
219
256
- ` command_name db.collection_name ` if the command is executed on a collection.
220
257
- ` command_name db ` if there is no specific collection for the command.
221
- - ` command_name ` in other cases (e.g., commands executed against ` admin ` database).
258
+ - ` command_name admin ` in other cases (e.g., commands executed against ` admin ` database, transaction or client
259
+ ` bulkWrite ` ).
222
260
223
261
###### db.query.text
224
262
@@ -269,32 +307,33 @@ See [OpenTelemetry Tests](tests/README.md) for the test plan.
269
307
270
308
The OpenTelemetry specification covers the following operations:
271
309
272
- | Operation | Test |
273
- | :----------------------- | :----------------------------------------------------------------------------------- |
274
- | ` aggregate ` | [ tests/transaction/aggregate.yml] ( tests/operation/aggregate.yml ) |
275
- | ` findAndModify ` | [ tests/transaction/find_one_and_update.yml] ( tests/operation/find_one_and_update.yml ) |
276
- | ` bulkWrite ` | [ tests/transaction/bulk_write.yml] ( tests/operation/bulk_write.yml ) |
277
- | ` commitTransaction ` | [ tests/transaction/transaction.yml] ( tests/transaction/transaction.yml ) |
278
- | ` abortTransaction ` | [ tests/transaction/transaction.yml] ( tests/transaction/transaction.yml ) |
279
- | ` createCollection ` | [ tests/transaction/create_collection.yml] ( tests/operation/create_collection.yml ) |
280
- | ` createIndexes ` | [ tests/transaction/create_indexes.yml] ( tests/operation/create_indexes.yml ) |
281
- | ` createView ` | [ tests/transaction/create_view.yml] ( tests/operation/create_view.yml ) |
282
- | ` distinct ` | [ tests/transaction/distinct.yml] ( tests/operation/distinct.yml ) |
283
- | ` dropCollection ` | [ tests/transaction/drop_collection.yml] ( tests/operation/drop_collection.yml ) |
284
- | ` dropIndexes ` | [ tests/transaction/drop_indexes.yml] ( tests/operation/drop_indexes.yml ) |
285
- | ` find ` | [ tests/transaction/find.yml] ( tests/operation/find.yml ) |
286
- | ` listCollections ` | [ tests/transaction/list_collections.yml] ( tests/operation/list_collections.yml ) |
287
- | ` listDatabases ` | [ tests/transaction/list_databases.yml] ( tests/operation/list_databases.yml ) |
288
- | ` listIndexes ` | [ tests/transaction/list_indexes.yml] ( tests/operation/list_indexes.yml ) |
289
- | ` mapReduce ` | [ tests/transaction/map_reduce.yml] ( tests/operation/map_reduce.yml ) |
290
- | ` estimatedDocumentCount ` | [ tests/transaction/count.yml] ( tests/operation/count.yml ) |
291
- | ` insert ` | [ tests/transaction/insert.yml] ( tests/operation/insert.yml ) |
292
- | ` delete ` | [ tests/transaction/delete.yml] ( tests/operation/delete.yml ) |
293
- | ` update ` | [ tests/transaction/update.yml] ( tests/operation/update.yml ) |
294
- | ` createSearchIndexes ` | [ tests/transaction/atlas_search.yml] ( tests/operation/atlas_search.yml ) |
295
- | ` dropSearchIndex ` | [ tests/transaction/atlas_search.yml] ( tests/operation/atlas_search.yml ) |
296
- | ` updateSearchIndex ` | [ tests/transaction/delete.yml] ( tests/operation/delete.yml ) |
297
- | ` delete ` | [ tests/transaction/atlas_search.yml] ( tests/operation/atlas_search.yml ) |
310
+ | Operation | Test |
311
+ | :----------------------- | :----------------------------------------------------------------------------- |
312
+ | ` aggregate ` | [ tests/operation/aggregate.yml] ( tests/operation/aggregate.yml ) |
313
+ | ` findAndModify ` | [ tests/operation/find_and_modify.yml] ( tests/operation/find_and_modify.yml ) |
314
+ | ` bulkWrite ` | [ tests/operation/bulk_write.yml] ( tests/operation/bulk_write.yml ) |
315
+ | ` commitTransaction ` | [ tests/transaction/core_api.yml] ( tests/transaction/core_api.yml ) |
316
+ | ` abortTransaction ` | [ tests/transaction/core_api.yml] ( tests/transaction/core_api.yml ) |
317
+ | ` withTransaction ` | [ tests/transaction/convenient.yml] ( tests/transaction/convenient.yml ) |
318
+ | ` createCollection ` | [ tests/operation/create_collection.yml] ( tests/operation/create_collection.yml ) |
319
+ | ` createIndexes ` | [ tests/operation/create_indexes.yml] ( tests/operation/create_indexes.yml ) |
320
+ | ` createView ` | [ tests/operation/create_view.yml] ( tests/operation/create_view.yml ) |
321
+ | ` distinct ` | [ tests/operation/distinct.yml] ( tests/operation/distinct.yml ) |
322
+ | ` dropCollection ` | [ tests/operation/drop_collection.yml] ( tests/operation/drop_collection.yml ) |
323
+ | ` dropIndexes ` | [ tests/operation/drop_indexes.yml] ( tests/operation/drop_indexes.yml ) |
324
+ | ` find ` | [ tests/operation/find.yml] ( tests/operation/find.yml ) |
325
+ | ` listCollections ` | [ tests/operation/list_collections.yml] ( tests/operation/list_collections.yml ) |
326
+ | ` listDatabases ` | [ tests/operation/list_databases.yml] ( tests/operation/list_databases.yml ) |
327
+ | ` listIndexes ` | [ tests/operation/list_indexes.yml] ( tests/operation/list_indexes.yml ) |
328
+ | ` mapReduce ` | [ tests/operation/map_reduce.yml] ( tests/operation/map_reduce.yml ) |
329
+ | ` estimatedDocumentCount ` | [ tests/operation/count.yml] ( tests/operation/count.yml ) |
330
+ | ` insert ` | [ tests/operation/insert.yml] ( tests/operation/insert.yml ) |
331
+ | ` delete ` | [ tests/operation/delete.yml] ( tests/operation/delete.yml ) |
332
+ | ` update ` | [ tests/operation/update.yml] ( tests/operation/update.yml ) |
333
+ | ` createSearchIndexes ` | [ tests/operation/atlas_search.yml] ( tests/operation/atlas_search.yml ) |
334
+ | ` dropSearchIndex ` | [ tests/operation/atlas_search.yml] ( tests/operation/atlas_search.yml ) |
335
+ | ` updateSearchIndex ` | [ tests/operation/delete.yml] ( tests/operation/delete.yml ) |
336
+ | ` delete ` | [ tests/operation/atlas_search.yml] ( tests/operation/atlas_search.yml ) |
298
337
299
338
## Backwards Compatibility
300
339
0 commit comments