Rename `db.operation` to `db.operation.name` (#875)
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
This commit is contained in:
parent
14c8e5291e
commit
f812621a91
|
|
@ -0,0 +1,4 @@
|
|||
change_type: breaking
|
||||
component: db
|
||||
note: Rename `db.operation` to `db.operation.name`.
|
||||
issues: [ 884 ]
|
||||
|
|
@ -25,15 +25,13 @@
|
|||
|---|---|---|---|---|
|
||||
| `db.instance.id` | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` |  |
|
||||
| `db.name` | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` |  |
|
||||
| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. [2] | `findAndModify`; `HMSET`; `SELECT` |  |
|
||||
| `db.operation.name` | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` |  |
|
||||
| `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` |  |
|
||||
| `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` |  |
|
||||
| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` |  |
|
||||
|
||||
**[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).
|
||||
|
||||
**[2]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.
|
||||
|
||||
`db.system` 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.
|
||||
|
||||
| Value | Description | Stability |
|
||||
|
|
@ -221,6 +219,7 @@
|
|||
| `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | <br>"Replaced by `server.address` and `server.port`." |
|
||||
| `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | <br>Replaced by `db.instance.id`. |
|
||||
| `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | <br>Removed as not used. |
|
||||
| `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | <br>Replaced by `db.operation.name`. |
|
||||
<!-- endsemconv -->
|
||||
|
||||
### Deprecated Elasticsearch Attributes
|
||||
|
|
@ -231,4 +230,5 @@
|
|||
| `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | <br>"Replaced by `server.address` and `server.port`." |
|
||||
| `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | <br>Replaced by `db.instance.id`. |
|
||||
| `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | <br>Removed as not used. |
|
||||
| `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | <br>Replaced by `db.operation.name`. |
|
||||
<!-- endsemconv -->
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@ described on this page.
|
|||
<!-- semconv db.couchdb(full,tag=tech-specific) -->
|
||||
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
||||
|---|---|---|---|---|---|
|
||||
| [`db.operation`](../attributes-registry/db.md) | string | The HTTP method + the target REST route. [1] | `GET /{db}/{docid}` | `Conditionally Required` If `db.statement` is not applicable. |  |
|
||||
| [`db.operation.name`](../attributes-registry/db.md) | string | The HTTP method + the target REST route. [1] | `GET /{db}/{docid}` | `Conditionally Required` [2] |  |
|
||||
|
||||
**[1]:** In **CouchDB**, `db.operation` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid).
|
||||
**[1]:** In **CouchDB**, `db.operation.name` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation.name` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid).
|
||||
|
||||
**[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.
|
||||
<!-- endsemconv -->
|
||||
|
||||
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ Some database systems may allow a connection to switch to a different `db.user`,
|
|||
|---|---|---|---|---|---|
|
||||
| [`db.system`](../attributes-registry/db.md) | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | `Required` |  |
|
||||
| [`db.name`](../attributes-registry/db.md) | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | `Conditionally Required` If applicable. |  |
|
||||
| [`db.operation`](../attributes-registry/db.md) | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. [2] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` If `db.statement` is not applicable. |  |
|
||||
| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [2] |  |
|
||||
| [`server.port`](../attributes-registry/server.md) | int | Server port number. [3] | `80`; `8080`; `443` | `Conditionally Required` [4] |  |
|
||||
| [`db.instance.id`](../attributes-registry/db.md) | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | `Recommended` If different from the `server.address` |  |
|
||||
| [`db.statement`](../attributes-registry/db.md) | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | `Recommended` [5] |  |
|
||||
|
|
@ -86,7 +86,7 @@ Some database systems may allow a connection to switch to a different `db.user`,
|
|||
|
||||
**[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).
|
||||
|
||||
**[2]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.
|
||||
**[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.
|
||||
|
||||
**[3]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
|
|||
<!-- semconv db.elasticsearch(full,tag=tech-specific) -->
|
||||
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
||||
|---|---|---|---|---|---|
|
||||
| [`db.operation`](../attributes-registry/db.md) | string | The endpoint identifier for the request. [1] | `search`; `ml.close_job`; `cat.aliases` | `Required` |  |
|
||||
| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [1] | `search`; `ml.close_job`; `cat.aliases` | `Required` |  |
|
||||
| [`http.request.method`](../attributes-registry/http.md) | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | `Required` |  |
|
||||
| [`url.full`](../attributes-registry/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [3] | `https://localhost:9200/index/_search?q=user.id:kimchy` | `Required` |  |
|
||||
| [`db.elasticsearch.path_parts.<key>`](../attributes-registry/db.md) | string | A dynamic value in the url path. [4] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | `Conditionally Required` when the url has dynamic values |  |
|
||||
|
|
@ -38,7 +38,7 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
|
|||
| [`network.peer.port`](../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`](../attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` |  |
|
||||
|
||||
**[1]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.
|
||||
**[1]:** This SHOULD be the endpoint identifier for the request.
|
||||
|
||||
**[2]:** HTTP request method value SHOULD be "known" to the instrumentation.
|
||||
By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ described on this page.
|
|||
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
||||
|---|---|---|---|---|---|
|
||||
| [`db.mongodb.collection`](../attributes-registry/db.md) | string | The MongoDB collection being accessed within the database stated in `db.name`. | `customers`; `products` | `Required` |  |
|
||||
| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the command being executed. [1] | `findAndModify`; `getMore`; `update` | `Conditionally Required` [2] |  |
|
||||
|
||||
**[1]:** See [MongoDB database commands](https://www.mongodb.com/docs/manual/reference/command/).
|
||||
|
||||
**[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.
|
||||
<!-- endsemconv -->
|
||||
|
||||
## Example
|
||||
|
|
|
|||
|
|
@ -17,12 +17,18 @@ described on this page.
|
|||
<!-- semconv db.mssql(full,tag=tech-specific) -->
|
||||
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
||||
|---|---|---|---|---|---|
|
||||
| [`db.mssql.instance_name`](../attributes-registry/db.md) | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | `Recommended` |  |
|
||||
| [`db.sql.table`](../attributes-registry/db.md) | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [2] | `public.users`; `customers` | `Recommended` |  |
|
||||
| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [1] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [2] |  |
|
||||
| [`db.mssql.instance_name`](../attributes-registry/db.md) | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [3] | `MSSQLSERVER` | `Recommended` |  |
|
||||
| [`db.sql.table`](../attributes-registry/db.md) | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [4] | `public.users`; `customers` | `Recommended` |  |
|
||||
|
||||
**[1]:** If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard).
|
||||
**[1]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`.
|
||||
In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed.
|
||||
|
||||
**[2]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
|
||||
**[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.
|
||||
|
||||
**[3]:** If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard).
|
||||
|
||||
**[4]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
|
||||
<!-- endsemconv -->
|
||||
|
||||
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md
|
||||
|
|
|
|||
|
|
@ -15,9 +15,15 @@ described on this page.
|
|||
<!-- semconv db.sql(full,tag=tech-specific) -->
|
||||
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
||||
|---|---|---|---|---|---|
|
||||
| [`db.sql.table`](../attributes-registry/db.md) | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [1] | `public.users`; `customers` | `Recommended` |  |
|
||||
| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [1] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [2] |  |
|
||||
| [`db.sql.table`](../attributes-registry/db.md) | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [3] | `public.users`; `customers` | `Recommended` |  |
|
||||
|
||||
**[1]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
|
||||
**[1]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`.
|
||||
In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed.
|
||||
|
||||
**[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.
|
||||
|
||||
**[3]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
|
||||
<!-- endsemconv -->
|
||||
|
||||
## Example
|
||||
|
|
|
|||
|
|
@ -245,19 +245,11 @@ groups:
|
|||
the database name to be used is the more specific layer (e.g. Oracle schema name).
|
||||
examples: [ 'customers', 'main' ]
|
||||
tag: db-generic
|
||||
- id: operation
|
||||
- id: operation.name
|
||||
type: string
|
||||
stability: experimental
|
||||
brief: >
|
||||
The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations)
|
||||
such as `findAndModify`, or the SQL keyword.
|
||||
note: >
|
||||
When setting this to an SQL keyword, it is not recommended to
|
||||
attempt any client-side parsing of `db.statement` just to get this
|
||||
property, but it should be set if the operation name is provided by
|
||||
the library being instrumented.
|
||||
If the SQL statement has an ambiguous operation, or performs more
|
||||
than one operation, this value may be omitted.
|
||||
The name of the operation or command being executed.
|
||||
examples: ['findAndModify', 'HMSET', 'SELECT']
|
||||
tag: db-generic
|
||||
- id: redis.database_index
|
||||
|
|
|
|||
|
|
@ -24,3 +24,9 @@ groups:
|
|||
deprecated: "Replaced by `db.instance.id`."
|
||||
stability: experimental
|
||||
examples: ["instance-0000000001"]
|
||||
- id: operation
|
||||
type: string
|
||||
brief: 'Deprecated, use `db.operation.name` instead.'
|
||||
stability: experimental
|
||||
deprecated: "Replaced by `db.operation.name`."
|
||||
examples: ['findAndModify', 'HMSET', 'SELECT']
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ groups:
|
|||
requirement_level:
|
||||
recommended: >
|
||||
Should be collected by default only if there is sanitization that excludes sensitive information.
|
||||
- ref: db.operation
|
||||
- ref: db.operation.name
|
||||
requirement_level:
|
||||
conditionally_required: If `db.statement` is not applicable.
|
||||
conditionally_required: >
|
||||
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.
|
||||
- ref: server.address
|
||||
brief: >
|
||||
Name of the database host.
|
||||
|
|
@ -113,15 +115,15 @@ groups:
|
|||
brief: >
|
||||
Attributes for CouchDB
|
||||
attributes:
|
||||
- ref: db.operation
|
||||
- ref: db.operation.name
|
||||
tag: tech-specific
|
||||
brief: >
|
||||
The HTTP method + the target REST route.
|
||||
examples: ['GET /{db}/{docid}']
|
||||
note: >
|
||||
In **CouchDB**, `db.operation` should be set to the HTTP method +
|
||||
In **CouchDB**, `db.operation.name` should be set to the HTTP method +
|
||||
the target REST route according to the API reference documentation.
|
||||
For example, when retrieving a document, `db.operation` would be set to
|
||||
For example, when retrieving a document, `db.operation.name` would be set to
|
||||
(literally, i.e., without replacing the placeholders with concrete values):
|
||||
[`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid).
|
||||
|
||||
|
|
@ -150,6 +152,13 @@ groups:
|
|||
brief: >
|
||||
Attributes for MongoDB
|
||||
attributes:
|
||||
- ref: db.operation.name
|
||||
brief: >
|
||||
The name of the command being executed.
|
||||
note: >
|
||||
See [MongoDB database commands](https://www.mongodb.com/docs/manual/reference/command/).
|
||||
examples: ['findAndModify', 'getMore', 'update']
|
||||
tag: tech-specific
|
||||
- ref: db.mongodb.collection
|
||||
requirement_level: required
|
||||
tag: tech-specific
|
||||
|
|
@ -163,9 +172,9 @@ groups:
|
|||
- ref: http.request.method
|
||||
requirement_level: required
|
||||
tag: tech-specific
|
||||
- ref: db.operation
|
||||
- ref: db.operation.name
|
||||
requirement_level: required
|
||||
brief: The endpoint identifier for the request.
|
||||
note: This SHOULD be the endpoint identifier for the request.
|
||||
examples: [ 'search', 'ml.close_job', 'cat.aliases' ]
|
||||
tag: tech-specific
|
||||
- ref: url.full
|
||||
|
|
@ -205,6 +214,13 @@ groups:
|
|||
brief: >
|
||||
Attributes for SQL databases
|
||||
attributes:
|
||||
- ref: db.operation.name
|
||||
note: >
|
||||
This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`.
|
||||
|
||||
In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed.
|
||||
examples: ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'CREATE', 'mystoredproc']
|
||||
tag: tech-specific
|
||||
- ref: db.sql.table
|
||||
tag: tech-specific
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ versions:
|
|||
- rename_attributes:
|
||||
attribute_map:
|
||||
messaging.kafka.destination.partition: messaging.destination.partition.id
|
||||
# https://github.com/open-telemetry/semantic-conventions/pull/875
|
||||
- rename_attributes:
|
||||
attribute_map:
|
||||
db.operation: db.operation.name
|
||||
metrics:
|
||||
changes:
|
||||
# https://github.com/open-telemetry/semantic-conventions/pull/484
|
||||
|
|
|
|||
Loading…
Reference in New Issue