diff --git a/model/db-common.yaml b/model/db-common.yaml index f007505261..cccfe64cbe 100644 --- a/model/db-common.yaml +++ b/model/db-common.yaml @@ -21,32 +21,3 @@ groups: 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. - - - id: attributes.db.client.all_common - type: attribute_group - brief: This group documents attributes that describe database call along with network information. - extends: attributes.db.client.minimal - attributes: - - 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.system - # TODO: Not adding to the minimal because of https://github.com/open-telemetry/build-tools/issues/192 - 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: db.namespace - requirement_level: - conditionally_required: If available. diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index 0d21a615e9..0b0823406c 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -6,8 +6,31 @@ groups: instrument: histogram unit: "s" stability: experimental - extends: attributes.db.client.all_common + extends: attributes.db.client.minimal + attributes: + - 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.system + # TODO: Not adding to the minimal because of https://github.com/open-telemetry/build-tools/issues/192 + 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: db.namespace + requirement_level: + conditionally_required: If available. - id: metric.db.client.connection.count type: metric metric_name: db.client.connection.count