Skip to content

Commit ce6bc33

Browse files
DRIVERS-3393 Update db.system.name attr for OTel (mongodb#1893)
1 parent e834520 commit ce6bc33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+142
-137
lines changed

source/open-telemetry/open-telemetry.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ below.
124124
##### Transactions
125125

126126
When a user starts a transaction with `startTransaction`, the driver SHOULD create a span for the pseudo operation
127-
`transaction`. This span MUST have only one attribute `db.system` with the value `mongodb`. All operations executed
127+
`transaction`. This span MUST have only one attribute `db.system.name` with the value `mongodb`. All operations executed
128128
within the transaction SHOULD be nested to the `transaction` span.
129129

130130
When a user commits or aborts a transaction with `commitTransaction` or `abortTransaction`, the driver SHOULD finish the
@@ -158,7 +158,7 @@ Spans SHOULD have the following attributes:
158158

159159
| Attribute | Type | Description | Requirement Level |
160160
| :--------------------- | :------- | :------------------------------------------------------------------------- | :-------------------- |
161-
| `db.system` | `string` | MUST be 'mongodb' | Required |
161+
| `db.system.name` | `string` | MUST be 'mongodb' | Required |
162162
| `db.namespace` | `string` | The database name | Required if available |
163163
| `db.collection.name` | `string` | The collection being accessed within the database stated in `db.namespace` | Required if available |
164164
| `db.operation.name` | `string` | The name of the driver operation being executed | Required |
@@ -234,7 +234,7 @@ Spans SHOULD have the following attributes:
234234

235235
| Attribute | Type | Description | Requirement Level |
236236
| :-------------------------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------- |
237-
| `db.system` | `string` | MUST be 'mongodb' | Required |
237+
| `db.system.name` | `string` | MUST be 'mongodb' | Required |
238238
| `db.namespace` | `string` | The database name | Required if available |
239239
| `db.collection.name` | `string` | The collection being accessed within the database stated in `db.namespace` | Required if available |
240240
| `db.command.name` | `string` | The name of the server command being executed | Required |
@@ -422,3 +422,8 @@ tracing may have unexpected negative outcome.
422422
Further, we already have two attributes that configure tracing, and we expect there might be more.
423423

424424
A URI options can be added later if we realise our users need it, while the opposite is not easily accomplished.
425+
426+
## Changelog
427+
428+
- 2026-02-09: Renamed `db.system` to `db.system.name` according to the corresponding update of OpenTelemetry semantic
429+
conventions.

source/open-telemetry/tests/operation/aggregate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
{
5353
"name": "aggregate operation-aggregate.test",
5454
"attributes": {
55-
"db.system": "mongodb",
55+
"db.system.name": "mongodb",
5656
"db.namespace": "operation-aggregate",
5757
"db.collection.name": "test",
5858
"db.operation.name": "aggregate",
@@ -62,7 +62,7 @@
6262
{
6363
"name": "aggregate",
6464
"attributes": {
65-
"db.system": "mongodb",
65+
"db.system.name": "mongodb",
6666
"db.namespace": "operation-aggregate",
6767
"db.collection.name": "test",
6868
"db.command.name": "aggregate",

source/open-telemetry/tests/operation/aggregate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ tests:
3030
spans:
3131
- name: aggregate operation-aggregate.test
3232
attributes:
33-
db.system: mongodb
33+
db.system.name: mongodb
3434
db.namespace: operation-aggregate
3535
db.collection.name: test
3636
db.operation.name: aggregate
@@ -39,7 +39,7 @@ tests:
3939
nested:
4040
- name: aggregate
4141
attributes:
42-
db.system: mongodb
42+
db.system.name: mongodb
4343
db.namespace: operation-aggregate
4444
db.collection.name: *collectionName0
4545
db.command.name: aggregate

source/open-telemetry/tests/operation/atlas_search.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
{
102102
"name": "createSearchIndexes operation-atlas-search.test",
103103
"attributes": {
104-
"db.system": "mongodb",
104+
"db.system.name": "mongodb",
105105
"db.namespace": "operation-atlas-search",
106106
"db.collection.name": "test",
107107
"db.operation.name": "createSearchIndexes",
@@ -111,7 +111,7 @@
111111
{
112112
"name": "createSearchIndexes",
113113
"attributes": {
114-
"db.system": "mongodb",
114+
"db.system.name": "mongodb",
115115
"db.namespace": "operation-atlas-search",
116116
"db.command.name": "createSearchIndexes",
117117
"db.collection.name": "test",
@@ -177,7 +177,7 @@
177177
{
178178
"name": "updateSearchIndex operation-atlas-search.test",
179179
"attributes": {
180-
"db.system": "mongodb",
180+
"db.system.name": "mongodb",
181181
"db.namespace": "operation-atlas-search",
182182
"db.collection.name": "test",
183183
"db.operation.name": "updateSearchIndex",
@@ -187,7 +187,7 @@
187187
{
188188
"name": "updateSearchIndex",
189189
"attributes": {
190-
"db.system": "mongodb",
190+
"db.system.name": "mongodb",
191191
"db.namespace": "operation-atlas-search",
192192
"db.command.name": "updateSearchIndex",
193193
"db.collection.name": "test",
@@ -245,7 +245,7 @@
245245
{
246246
"name": "dropSearchIndex operation-atlas-search.test",
247247
"attributes": {
248-
"db.system": "mongodb",
248+
"db.system.name": "mongodb",
249249
"db.namespace": "operation-atlas-search",
250250
"db.collection.name": "test",
251251
"db.operation.name": "dropSearchIndex",
@@ -255,7 +255,7 @@
255255
{
256256
"name": "dropSearchIndex",
257257
"attributes": {
258-
"db.system": "mongodb",
258+
"db.system.name": "mongodb",
259259
"db.namespace": "operation-atlas-search",
260260
"db.command.name": "dropSearchIndex",
261261
"db.collection.name": "test",

source/open-telemetry/tests/operation/atlas_search.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ tests:
7070
spans:
7171
- name: createSearchIndexes operation-atlas-search.test
7272
attributes:
73-
db.system: mongodb
73+
db.system.name: mongodb
7474
db.namespace: operation-atlas-search
7575
db.collection.name: test
7676
db.operation.name: createSearchIndexes
7777
db.operation.summary: createSearchIndexes operation-atlas-search.test
7878
nested:
7979
- name: createSearchIndexes
8080
attributes:
81-
db.system: mongodb
81+
db.system.name: mongodb
8282
db.namespace: operation-atlas-search
8383
db.command.name: createSearchIndexes
8484
db.collection.name: test
@@ -103,7 +103,7 @@ tests:
103103

104104
- name: updateSearchIndex operation-atlas-search.test
105105
attributes:
106-
db.system: mongodb
106+
db.system.name: mongodb
107107
db.namespace: operation-atlas-search
108108
db.collection.name: test
109109
db.operation.name: updateSearchIndex
@@ -112,7 +112,7 @@ tests:
112112
nested:
113113
- name: updateSearchIndex
114114
attributes:
115-
db.system: mongodb
115+
db.system.name: mongodb
116116
db.namespace: operation-atlas-search
117117
db.command.name: updateSearchIndex
118118
db.collection.name: test
@@ -138,15 +138,15 @@ tests:
138138

139139
- name: dropSearchIndex operation-atlas-search.test
140140
attributes:
141-
db.system: mongodb
141+
db.system.name: mongodb
142142
db.namespace: operation-atlas-search
143143
db.collection.name: test
144144
db.operation.name: dropSearchIndex
145145
db.operation.summary: dropSearchIndex operation-atlas-search.test
146146
nested:
147147
- name: dropSearchIndex
148148
attributes:
149-
db.system: mongodb
149+
db.system.name: mongodb
150150
db.namespace: operation-atlas-search
151151
db.command.name: dropSearchIndex
152152
db.collection.name: test

source/open-telemetry/tests/operation/bulk_write.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
{
169169
"name": "bulkWrite admin",
170170
"attributes": {
171-
"db.system": "mongodb",
171+
"db.system.name": "mongodb",
172172
"db.namespace": "admin",
173173
"db.collection.name": {
174174
"$$exists": false
@@ -180,7 +180,7 @@
180180
{
181181
"name": "bulkWrite",
182182
"attributes": {
183-
"db.system": "mongodb",
183+
"db.system.name": "mongodb",
184184
"db.namespace": "admin",
185185
"db.collection.name": {
186186
"$$exists": false

source/open-telemetry/tests/operation/bulk_write.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ tests:
7777
spans:
7878
- name: bulkWrite admin
7979
attributes:
80-
db.system: mongodb
80+
db.system.name: mongodb
8181
db.namespace: admin
8282
db.collection.name: { $$exists: false }
8383
db.operation.name: bulkWrite
8484
db.operation.summary: bulkWrite admin
8585
nested:
8686
- name: bulkWrite
8787
attributes:
88-
db.system: mongodb
88+
db.system.name: mongodb
8989
db.namespace: admin
9090
db.collection.name: { $$exists: false }
9191
db.command.name: bulkWrite

source/open-telemetry/tests/operation/count.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
{
5353
"name": "count operation-count.test",
5454
"attributes": {
55-
"db.system": "mongodb",
55+
"db.system.name": "mongodb",
5656
"db.namespace": "operation-count",
5757
"db.collection.name": "test",
5858
"db.operation.name": "count",
@@ -62,7 +62,7 @@
6262
{
6363
"name": "count",
6464
"attributes": {
65-
"db.system": "mongodb",
65+
"db.system.name": "mongodb",
6666
"db.namespace": "operation-count",
6767
"db.collection.name": "test",
6868
"db.command.name": "count",

source/open-telemetry/tests/operation/count.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ tests:
3232
spans:
3333
- name: count operation-count.test
3434
attributes:
35-
db.system: mongodb
35+
db.system.name: mongodb
3636
db.namespace: *database0Name
3737
db.collection.name: *collection0Name
3838
db.operation.name: count
3939
db.operation.summary: count operation-count.test
4040
nested:
4141
- name: count
4242
attributes:
43-
db.system: mongodb
43+
db.system.name: mongodb
4444
db.namespace: *database0Name
4545
db.collection.name: *collection0Name
4646
db.command.name: count

source/open-telemetry/tests/operation/create_collection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{
4040
"name": "createCollection operation-create-collection.newlyCreatedCollection",
4141
"attributes": {
42-
"db.system": "mongodb",
42+
"db.system.name": "mongodb",
4343
"db.namespace": "operation-create-collection",
4444
"db.collection.name": "newlyCreatedCollection",
4545
"db.operation.name": "createCollection",
@@ -49,7 +49,7 @@
4949
{
5050
"name": "create",
5151
"attributes": {
52-
"db.system": "mongodb",
52+
"db.system.name": "mongodb",
5353
"db.namespace": "operation-create-collection",
5454
"db.collection.name": "newlyCreatedCollection",
5555
"db.command.name": "create",

0 commit comments

Comments
 (0)