Add support for database batch operations (#1072)
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
This commit is contained in:
parent
c98600cf91
commit
e3217bea91
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Use this changelog template to create an entry for release notes.
|
||||||
|
#
|
||||||
|
# If your change doesn't affect end users you should instead start
|
||||||
|
# your pull request title with [chore] or use the "Skip Changelog" label.
|
||||||
|
|
||||||
|
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
|
||||||
|
change_type: enhancement
|
||||||
|
|
||||||
|
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
|
||||||
|
component: db
|
||||||
|
|
||||||
|
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
|
||||||
|
note: Add support for database batch operations
|
||||||
|
|
||||||
|
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
|
||||||
|
# The values here must be integers.
|
||||||
|
issues: [ 712 ]
|
||||||
|
|
||||||
|
# (Optional) One or more lines of additional information to render under the primary note.
|
||||||
|
# These lines will be padded with 2 spaces and then inserted directly into the document.
|
||||||
|
# Use pipe (|) for multiline entries.
|
||||||
|
subtext:
|
||||||
|
|
@ -23,25 +23,32 @@ This group defines the attributes used to describe telemetry in the context of d
|
||||||
| `db.client.connections.state` | string | The state of a connection in the pool | `idle` |  |
|
| `db.client.connections.state` | string | The state of a connection in the pool | `idle` |  |
|
||||||
| `db.collection.name` | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` |  |
|
| `db.collection.name` | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` |  |
|
||||||
| `db.namespace` | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` |  |
|
| `db.namespace` | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` |  |
|
||||||
| `db.operation.name` | string | The name of the operation or command being executed. [3] | `findAndModify`; `HMSET`; `SELECT` |  |
|
| `db.operation.batch.size` | int | The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations). [3] | `2`; `3`; `4` |  |
|
||||||
| `db.query.parameter.<key>` | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [4] | `someval`; `55` |  |
|
| `db.operation.name` | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` |  |
|
||||||
| `db.query.text` | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` |  |
|
| `db.query.parameter.<key>` | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [5] | `someval`; `55` |  |
|
||||||
| `db.system` | string | The database management system (DBMS) product as identified by the client instrumentation. [5] | `other_sql`; `adabas`; `cache` |  |
|
| `db.query.text` | string | The database query being executed. [6] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` |  |
|
||||||
|
| `db.system` | string | The database management system (DBMS) product as identified by the client instrumentation. [7] | `other_sql`; `adabas`; `cache` |  |
|
||||||
|
|
||||||
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[2]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid.
|
**[2]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid.
|
||||||
Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system.
|
Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system.
|
||||||
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
|
|
||||||
**[3]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[3]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
|
||||||
|
|
||||||
**[4]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
**[4]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
|
**[5]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
||||||
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
||||||
|
|
||||||
**[5]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge.
|
**[6]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
|
**[7]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge.
|
||||||
|
|
||||||
`db.client.connections.state` 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.
|
`db.client.connections.state` 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.
|
||||||
|
|
||||||
|
|
@ -206,9 +213,9 @@ This group defines attributes for Elasticsearch.
|
||||||
| ----------------------------------- | ------ | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
| ----------------------------------- | ------ | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||||
| `db.elasticsearch.cluster.name` | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` |  |
|
| `db.elasticsearch.cluster.name` | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` |  |
|
||||||
| `db.elasticsearch.node.name` | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` |  |
|
| `db.elasticsearch.node.name` | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` |  |
|
||||||
| `db.elasticsearch.path_parts.<key>` | string | A dynamic value in the url path. [6] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` |  |
|
| `db.elasticsearch.path_parts.<key>` | string | A dynamic value in the url path. [8] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` |  |
|
||||||
|
|
||||||
**[6]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` 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.
|
**[8]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` 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.
|
||||||
|
|
||||||
## Db Metrics Deprecated Attributes
|
## Db Metrics Deprecated Attributes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,15 @@ described on this page.
|
||||||
| [`db.cassandra.idempotence`](/docs/attributes-registry/db.md) | boolean | Whether or not the query is idempotent. | | `Recommended` |  |
|
| [`db.cassandra.idempotence`](/docs/attributes-registry/db.md) | boolean | Whether or not the query is idempotent. | | `Recommended` |  |
|
||||||
| [`db.cassandra.page_size`](/docs/attributes-registry/db.md) | int | The fetch size used for paging, i.e. how many rows will be returned at once. | `5000` | `Recommended` |  |
|
| [`db.cassandra.page_size`](/docs/attributes-registry/db.md) | int | The fetch size used for paging, i.e. how many rows will be returned at once. | `5000` | `Recommended` |  |
|
||||||
| [`db.cassandra.speculative_execution_count`](/docs/attributes-registry/db.md) | int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. | `0`; `2` | `Recommended` |  |
|
| [`db.cassandra.speculative_execution_count`](/docs/attributes-registry/db.md) | int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. | `0`; `2` | `Recommended` |  |
|
||||||
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [9] |  |
|
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [9] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] |  |
|
||||||
| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [10] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [11] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
| [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. |  |
|
| [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. |  |
|
||||||
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [12] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [12] | `someval`; `55` | `Opt-In` |  |
|
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [13] | `someval`; `55` | `Opt-In` |  |
|
||||||
|
|
||||||
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ If the collection name is parsed from the query text, it SHOULD be the first col
|
||||||
|
|
||||||
**[4]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[4]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
**[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
**[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
|
@ -58,13 +60,15 @@ If the operation name is parsed from the query text, it SHOULD be the first oper
|
||||||
|
|
||||||
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
||||||
|
|
||||||
**[9]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
**[9]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
**[10]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
|
**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
||||||
|
|
||||||
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
**[11]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
|
||||||
|
|
||||||
**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||||
|
|
||||||
|
**[13]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
||||||
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,18 +38,20 @@ Cosmos DB instrumentation includes call-level (public API) surface spans and net
|
||||||
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] |  |
|
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] |  |
|
||||||
| [`db.cosmosdb.client_id`](/docs/attributes-registry/db.md) | string | Unique Cosmos client instance id. | `3ba4827d-4422-483f-b59f-85b74211c11d` | `Recommended` |  |
|
| [`db.cosmosdb.client_id`](/docs/attributes-registry/db.md) | string | Unique Cosmos client instance id. | `3ba4827d-4422-483f-b59f-85b74211c11d` | `Recommended` |  |
|
||||||
| [`db.cosmosdb.request_content_length`](/docs/attributes-registry/db.md) | int | Request payload size in bytes | | `Recommended` |  |
|
| [`db.cosmosdb.request_content_length`](/docs/attributes-registry/db.md) | int | Request payload size in bytes | | `Recommended` |  |
|
||||||
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [8] |  |
|
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [8] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [9] |  |
|
||||||
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
| [`user_agent.original`](/docs/attributes-registry/user-agent.md) | string | Full user-agent string is generated by Cosmos DB SDK [10] | `cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|` | `Recommended` |  |
|
| [`user_agent.original`](/docs/attributes-registry/user-agent.md) | string | Full user-agent string is generated by Cosmos DB SDK [11] | `cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|` | `Recommended` |  |
|
||||||
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [11] | `someval`; `55` | `Opt-In` |  |
|
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [12] | `someval`; `55` | `Opt-In` |  |
|
||||||
|
|
||||||
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[2]:** <!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
|
**[2]:** <!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
|
||||||
|
|
||||||
**[3]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[3]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
**[4]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
**[4]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
|
@ -59,15 +61,17 @@ If the operation name is parsed from the query text, it SHOULD be the first oper
|
||||||
|
|
||||||
**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
||||||
|
|
||||||
**[8]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
**[8]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
**[9]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
**[9]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
||||||
|
|
||||||
**[10]:** The user-agent value is generated by SDK which is a combination of<br> `sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'<br> `direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'<br> `number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'<br> `type_of_machine_architecture` : Machine architecture. e.g. 'X64'<br> `operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'<br> `runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'<br> `failover_information` : Generated key to determine if region failover enabled.
|
**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||||
|
|
||||||
|
**[11]:** The user-agent value is generated by SDK which is a combination of<br> `sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'<br> `direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'<br> `number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'<br> `type_of_machine_architecture` : Machine architecture. e.g. 'X64'<br> `operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'<br> `runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'<br> `failover_information` : Generated key to determine if region failover enabled.
|
||||||
Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it).
|
Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it).
|
||||||
Default value is "NS".
|
Default value is "NS".
|
||||||
|
|
||||||
**[11]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
||||||
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,11 @@ of `[ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ]`.
|
||||||
|
|
||||||
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
|
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
|
||||||
| -------- | --------------- | ----------- | -------------- | --------- |
|
| -------- | --------------- | ----------- | -------------- | --------- |
|
||||||
| `db.client.operation.duration` | Histogram | `s` | Duration of database client operations. |  |
|
| `db.client.operation.duration` | Histogram | `s` | Duration of database client operations. [1] |  |
|
||||||
|
|
||||||
|
|
||||||
|
**[1]:** Batch operations SHOULD be recorded as a single operation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- markdownlint-restore -->
|
<!-- markdownlint-restore -->
|
||||||
|
|
@ -110,6 +114,7 @@ of `[ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ]`.
|
||||||
|
|
||||||
**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[3]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name in the query.
|
**[3]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name in the query.
|
||||||
|
|
||||||
|
|
@ -119,6 +124,7 @@ It is RECOMMENDED to capture the value as provided by the application without at
|
||||||
|
|
||||||
**[5]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[5]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
**[6]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
**[6]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,16 +95,17 @@ These attributes will usually be the same for all operations performed over the
|
||||||
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [5] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [6] |  |
|
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [5] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [6] |  |
|
||||||
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. |  |
|
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. |  |
|
||||||
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] |  |
|
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] |  |
|
||||||
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] |  |
|
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [10] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [11] |  |
|
||||||
| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [11] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. |  |
|
| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [12] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. |  |
|
||||||
| [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. |  |
|
| [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. |  |
|
||||||
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [12] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [13] | `someval`; `55` | `Opt-In` |  |
|
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [14] | `someval`; `55` | `Opt-In` |  |
|
||||||
|
|
||||||
**[1]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge.
|
**[1]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge.
|
||||||
|
|
||||||
**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[3]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
**[3]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
||||||
|
|
||||||
|
|
@ -114,6 +115,7 @@ It is RECOMMENDED to capture the value as provided by the application without at
|
||||||
|
|
||||||
**[5]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[5]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
**[6]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
**[6]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
|
@ -123,14 +125,16 @@ If the operation name is parsed from the query text, it SHOULD be the first oper
|
||||||
|
|
||||||
**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
||||||
|
|
||||||
**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
**[10]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
**[11]:** 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.
|
**[11]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
||||||
|
|
||||||
|
**[12]:** 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.
|
If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
|
||||||
|
|
||||||
**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||||
|
|
||||||
**[13]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
||||||
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
|
||||||
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] |  |
|
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] |  |
|
||||||
| [`db.elasticsearch.cluster.name`](/docs/attributes-registry/db.md) | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` | `Recommended` [8] |  |
|
| [`db.elasticsearch.cluster.name`](/docs/attributes-registry/db.md) | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` | `Recommended` [8] |  |
|
||||||
| [`db.elasticsearch.node.name`](/docs/attributes-registry/db.md) | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | `Recommended` [9] |  |
|
| [`db.elasticsearch.node.name`](/docs/attributes-registry/db.md) | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | `Recommended` [9] |  |
|
||||||
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [10] |  |
|
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. [10] | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [11] |  |
|
||||||
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [12] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
|
|
||||||
**[1]:** This SHOULD be the endpoint identifier for the request.
|
**[1]:** This SHOULD be the endpoint identifier for the request.
|
||||||
|
|
||||||
|
|
@ -76,9 +76,11 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original
|
||||||
|
|
||||||
**[9]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.
|
**[9]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.
|
||||||
|
|
||||||
**[10]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.
|
**[10]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
**[11]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.
|
||||||
|
|
||||||
|
**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ described on this page.
|
||||||
|
|
||||||
**[3]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[3]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
**[4]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
**[4]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ described on this page.
|
||||||
|
|
||||||
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[2]:** <!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
|
**[2]:** <!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,13 @@ described on this page.
|
||||||
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] |  |
|
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] |  |
|
||||||
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. |  |
|
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. |  |
|
||||||
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] |  |
|
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] |  |
|
||||||
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [9] |  |
|
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [9] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] |  |
|
||||||
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [11] | `someval`; `55` | `Opt-In` |  |
|
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [12] | `someval`; `55` | `Opt-In` |  |
|
||||||
|
|
||||||
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
||||||
|
|
||||||
|
|
@ -51,11 +52,13 @@ In the case of `EXEC`, this SHOULD be the stored procedure name that is being ex
|
||||||
|
|
||||||
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
||||||
|
|
||||||
**[9]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
**[9]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
||||||
|
|
||||||
**[11]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||||
|
|
||||||
|
**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
||||||
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ For commands that switch the database, this SHOULD be set to the target database
|
||||||
|
|
||||||
**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
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.
|
||||||
|
|
||||||
**[3]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
**[3]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,13 @@ described on this page.
|
||||||
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] |  |
|
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] |  |
|
||||||
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. |  |
|
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. |  |
|
||||||
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] |  |
|
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] |  |
|
||||||
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [9] |  |
|
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [9] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] |  |
|
||||||
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||||
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [11] | `someval`; `55` | `Opt-In` |  |
|
| [`db.query.parameter.<key>`](/docs/attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [12] | `someval`; `55` | `Opt-In` |  |
|
||||||
|
|
||||||
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
|
|
||||||
**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query.
|
||||||
|
|
||||||
|
|
@ -66,11 +67,13 @@ In the case of `EXEC`, this SHOULD be the stored procedure name that is being ex
|
||||||
|
|
||||||
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
|
||||||
|
|
||||||
**[9]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
**[9]:** For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
|
||||||
|
|
||||||
**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
|
||||||
|
|
||||||
**[11]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||||
|
|
||||||
|
**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
|
||||||
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ groups:
|
||||||
type: metric
|
type: metric
|
||||||
metric_name: db.client.operation.duration
|
metric_name: db.client.operation.duration
|
||||||
brief: "Duration of database client operations."
|
brief: "Duration of database client operations."
|
||||||
|
note: >
|
||||||
|
Batch operations SHOULD be recorded as a single operation.
|
||||||
instrument: histogram
|
instrument: histogram
|
||||||
unit: "s"
|
unit: "s"
|
||||||
stability: experimental
|
stability: experimental
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ groups:
|
||||||
|
|
||||||
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query
|
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query
|
||||||
and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
and it SHOULD match the value provided in the query text including any schema and database name prefix.
|
||||||
|
|
||||||
|
For batch operations, if the individual operations are known to have the same collection name
|
||||||
|
then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
|
||||||
examples: ['public.users', 'customers']
|
examples: ['public.users', 'customers']
|
||||||
- id: namespace
|
- id: namespace
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -40,12 +43,20 @@ groups:
|
||||||
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
|
||||||
|
|
||||||
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
|
||||||
|
|
||||||
|
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.
|
||||||
examples: ['findAndModify', 'HMSET', 'SELECT']
|
examples: ['findAndModify', 'HMSET', 'SELECT']
|
||||||
- id: query.text
|
- id: query.text
|
||||||
type: string
|
type: string
|
||||||
stability: experimental
|
stability: experimental
|
||||||
brief: >
|
brief: >
|
||||||
The database query being executed.
|
The database query being executed.
|
||||||
|
note: >
|
||||||
|
For batch operations, if the individual operations are known to have the same query text
|
||||||
|
then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated
|
||||||
|
with separator `; ` or some other database system specific separator if more applicable.
|
||||||
examples: ['SELECT * FROM wuser_table where username = ?', 'SET mykey "WuValue"']
|
examples: ['SELECT * FROM wuser_table where username = ?', 'SET mykey "WuValue"']
|
||||||
- id: query.parameter
|
- id: query.parameter
|
||||||
type: template[string]
|
type: template[string]
|
||||||
|
|
@ -59,6 +70,14 @@ groups:
|
||||||
If a parameter has no name and instead is referenced only by index,
|
If a parameter has no name and instead is referenced only by index,
|
||||||
then `<key>` SHOULD be the 0-based index.
|
then `<key>` SHOULD be the 0-based index.
|
||||||
examples: ['someval', '55']
|
examples: ['someval', '55']
|
||||||
|
- id: operation.batch.size
|
||||||
|
type: int
|
||||||
|
stability: experimental
|
||||||
|
brief: The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations).
|
||||||
|
note: >
|
||||||
|
Operations are only considered batches when they contain two or more operations,
|
||||||
|
and so `db.operation.batch.size` SHOULD never be `1`.
|
||||||
|
examples: [ 2, 3, 4 ]
|
||||||
- id: system
|
- id: system
|
||||||
brief: The database management system (DBMS) product as identified by the client instrumentation.
|
brief: The database management system (DBMS) product as identified by the client instrumentation.
|
||||||
note: >
|
note: >
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue