groups: - id: attributes.db.client type: attribute_group brief: 'Database Client attributes' attributes: - ref: db.namespace requirement_level: conditionally_required: If available. - ref: db.collection.name requirement_level: conditionally_required: > If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.collection.name`, then it SHOULD be the first collection name found in the query. - ref: db.operation.name requirement_level: conditionally_required: > If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. - ref: db.system requirement_level: required - ref: network.peer.address brief: Peer address of the database node where the operation was performed. requirement_level: recommended: If applicable for this database system. note: > Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - ref: network.peer.port requirement_level: recommended: if and only if `network.peer.address` is set. - ref: server.address brief: > Name of the database host. - ref: server.port requirement_level: conditionally_required: If using a port other than the default port for this DBMS and if `server.address` is set. - ref: error.type requirement_level: conditionally_required: If and only if the operation failed. note: > The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report.