diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 087608fb9c..2d7f7ff25e 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -191,6 +191,20 @@ This group defines attributes for Azure Cosmos DB. | `db.cosmosdb.request_charge` | double | Request units consumed for the operation. | `46.18`; `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.request_content_length` | int | Request payload size in bytes. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.sub_status_code` | int | Cosmos DB sub status code. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.operation.name` | string | The name of the operation or command being executed. [10] | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[10]:** It is RECOMMENDED to capture the value as provided by the application +without attempting to do any case normalization. + +The operation name SHOULD NOT be extracted from `db.query.text`, +unless the query format is known to only ever have a single operation name present. + +For batch operations, if the individual operations are known to have the same operation name +then that operation name SHOULD be used prepended by `BATCH `, +otherwise `db.operation.name` SHOULD be `BATCH` or some other database +system specific term if more applicable. + +This attribute has stability level RELEASE CANDIDATE. `db.cosmosdb.connection_mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -216,9 +230,9 @@ This group defines attributes for Elasticsearch. | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `db.elasticsearch.node.name` | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.elasticsearch.path_parts.` | string | A dynamic value in the url path. [10] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.elasticsearch.path_parts.` | string | A dynamic value in the url path. [11] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[10]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +**[11]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. ## Deprecated Database Attributes diff --git a/model/database/registry.yaml b/model/database/registry.yaml index 35ab782549..51439137ba 100644 --- a/model/database/registry.yaml +++ b/model/database/registry.yaml @@ -483,6 +483,13 @@ groups: brief: > This group defines attributes for Azure Cosmos DB. attributes: + - ref: db.operation.name + sampling_relevant: true + requirement_level: # TODO (trask) simplify + conditionally_required: > + If readily available and if there is a single operation name that describes the + database call. The operation name MAY be parsed from the query text, + in which case it SHOULD be the single operation name found in the query. - id: db.cosmosdb.client_id type: string stability: experimental