2.3 KiB
2.3 KiB
Semantic Conventions for MongoDB
Status: Experimental
The Semantic Conventions for MongoDB extend and override the Database Semantic Conventions that describe common database operations attributes in addition to the Semantic Conventions described on this page.
db.system MUST be set to "mongodb".
Attributes
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
db.mongodb.collection |
string | The MongoDB collection being accessed within the database stated in db.name. |
customers; products |
Required |
|
db.operation.name |
string | The name of the command being executed. [1] | findAndModify; getMore; update |
Conditionally Required [2] |
[1]: See MongoDB database commands.
[2]: If readily available. Otherwise, if the instrumentation library parses db.statement to capture db.operation.name, then it SHOULD be the first operation name found in the query.
Example
| Key | Value |
|---|---|
| Span name | "products.findAndModify" |
db.system |
"mongodb" |
db.user |
"the_user" |
server.address |
"mongodb0.example.com" |
server.port |
27017 |
network.peer.address |
"192.0.2.14" |
network.peer.port |
27017 |
network.transport |
"tcp" |
db.name |
"shopDb" |
db.statement |
not set |
db.operation |
"findAndModify" |
db.mongodb.collection |
"products" |