You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`db.system`|`string`| MUST be 'mongodb' | Required |
183
-
|`db.namespace`|`string`| The database name | Required if available |
184
-
|`db.collection.name`|`string`| The collection being accessed within the database stated in `db.namespace`| Required if available |
185
-
|`db.command.name`|`string`| The name of the server command being executed | Required |
186
-
|`db.response.status_code`|`string`| MongoDB error code represented as a string. This attribute should be added only if an error happens. | Required if an error happens |
187
-
|`error.type`|`string`| Describes a class of error the operation ended with. This attribute should be added only if an error happens. Examples: `timeout; java.net.UnknownHostException; server_certificate_invalid; 500`. | Required if an error happens |
188
-
|`server.port`|`int64`| Server port number | Required |
189
-
|`server.address`|`string`| Name of the database host, or IP address if name is not known | Required |
190
-
|`network.transport`|`string`| MUST be 'tcp' or 'unix' depending on the protocol | Required |
191
-
|`db.query.summary`|`string`| Equivalent to span name | Required |
192
-
|`db.mongodb.server_connection_id`|`int64`| Server connection id | Required if available |
193
-
|`db.mongodb.driver_connection_id`|`int64`| Local connection id | Required if available |
194
-
|`db.query.text`|`string`| Database command that was sent to the server. Content should be equivalent to the `document` field of the CommandStartedEvent of the command monitoring. | Conditional |
195
-
|`db.mongodb.cursor_id`|`int64`| If a cursor is created or used in the operation | Required if available |
176
+
| Attribute | Type | Description | Requirement Level |
|`db.system`|`string`| MUST be 'mongodb' | Required |
179
+
|`db.namespace`|`string`| The database name | Required if available |
180
+
|`db.collection.name`|`string`| The collection being accessed within the database stated in `db.namespace`| Required if available |
181
+
|`db.command.name`|`string`| The name of the server command being executed | Required |
182
+
|`db.response.status_code`|`string`| MongoDB error code represented as a string. This attribute should be added only if an error happens. | Required if an error happens |
183
+
|`server.port`|`int64`| Server port number | Required |
184
+
|`server.address`|`string`| Name of the database host, or IP address if name is not known | Required |
185
+
|`network.transport`|`string`| MUST be 'tcp' or 'unix' depending on the protocol | Required |
186
+
|`db.query.summary`|`string`| Equivalent to span name | Required |
187
+
|`db.mongodb.server_connection_id`|`int64`| Server connection id | Required if available |
188
+
|`db.mongodb.driver_connection_id`|`int64`| Local connection id | Required if available |
189
+
|`db.query.text`|`string`| Database command that was sent to the server. Content should be equivalent to the `document` field of the CommandStartedEvent of the command monitoring. | Conditional |
190
+
|`db.mongodb.cursor_id`|`int64`| If a cursor is created or used in the operation | Required if available |
196
191
197
192
Besides the attributes listed in the table above, drivers MAY add other attributes from the
198
193
[Semantic Conventions for Databases](https://opentelemetry.io/docs/specs/semconv/registry/attributes/db/) that are
199
194
applicable to MongoDB.
200
195
201
-
###### db.response.status_code and error.type
202
-
203
-
These attributes should be added only if the command was not successful. The content of `error.type` is language
204
-
specific; a driver decides what best describes the error.
205
-
206
196
###### db.query.text
207
197
208
198
This attribute contains the full database command executed serialized to extended JSON. If not truncated, the content of
0 commit comments