diff --git a/.chloggen/894.yaml b/.chloggen/894.yaml new file mode 100644 index 0000000000..23f73b1f2c --- /dev/null +++ b/.chloggen/894.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: db +note: Deprecate the `db.user` attribute. +issues: [ 885 ] diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 7ed3b02f92..ea89a0c930 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -27,7 +27,6 @@ | `db.operation.name` | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[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). @@ -219,4 +218,5 @@ | `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.instance.id`. | | `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed as not used. | | `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | +| `db.user` | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
No replacement at this time. | diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 4b2f1d0d7a..339313e282 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -68,7 +68,6 @@ with all retries. ## Common attributes These attributes will usually be the same for all operations performed over the same database connection. -Some database systems may allow a connection to switch to a different `db.user`, for example, and other database systems may not even have the concept of a connection at all. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | @@ -79,7 +78,6 @@ Some database systems may allow a connection to switch to a different `db.user`, | [`server.port`](../attributes-registry/server.md) | int | Server port number. [3] | `80`; `8080`; `443` | `Conditionally Required` [4] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.statement`](../attributes-registry/db.md) | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | `Recommended` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.user`](../attributes-registry/db.md) | string | Username for accessing the database. | `readonly_user`; `reporting_user` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [6] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`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. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`server.address`](../attributes-registry/server.md) | string | Name of the database host. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index 7be3e0559e..473cf4c137 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -31,7 +31,6 @@ described on this page. | :---------------------- | :----------------------------------------------------------- | | Span name | `"products.findAndModify"` | | `db.system` | `"mongodb"` | -| `db.user` | `"the_user"` | | `server.address` | `"mongodb0.example.com"` | | `server.port` | `27017` | | `network.peer.address` | `"192.0.2.14"` | diff --git a/docs/database/redis.md b/docs/database/redis.md index da70edf142..6007bb57b1 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -38,7 +38,6 @@ Furthermore, `db.name` is not specified as there is no database name in Redis an |:--------------------------| :-------------------------------------------- | | Span name | `"HMSET myhash"` | | `db.system` | `"redis"` | -| `db.user` | not set | | `network.peer.address` | `"/tmp/redis.sock"` | | `network.transport` | `"unix"` | | `db.name` | not set | diff --git a/docs/database/sql.md b/docs/database/sql.md index 7c53a45e5d..0427c20872 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -34,7 +34,6 @@ This is an example of attributes for a MySQL database span: |:------------------------| :----------------------------------------------------------- | | Span name | `"SELECT ShopDb.orders"` | | `db.system` | `"mysql"` | -| `db.user` | `"billing_user"` | | `server.address` | `"shopdb.example.com"` | | `server.port` | `3306` | | `network.peer.address` | `"192.0.2.12"` | diff --git a/docs/general/attribute-naming.md b/docs/general/attribute-naming.md index 9f4e93dd45..57a99b62cd 100644 --- a/docs/general/attribute-naming.md +++ b/docs/general/attribute-naming.md @@ -60,7 +60,7 @@ Names SHOULD follow these rules: ## Name Pluralization guidelines - When an attribute represents a single entity, the attribute name SHOULD be - singular. Examples: `host.name`, `db.user`, `container.id`. + singular. Examples: `host.name`, `container.id`. - When attribute can represent multiple entities, the attribute name SHOULD be pluralized and the value type SHOULD be an array. E.g. `process.command_args` diff --git a/model/registry/db.yaml b/model/registry/db.yaml index ec67346e39..83b71d16a6 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -494,13 +494,6 @@ groups: stability: experimental stability: experimental tag: db-generic - - id: user - type: string - stability: experimental - brief: > - Username for accessing the database. - examples: ['readonly_user', 'reporting_user'] - tag: db-generic - id: instance.id tag: db-generic type: string diff --git a/model/registry/deprecated/db.yaml b/model/registry/deprecated/db.yaml index 2adef825d3..b861dd7fd6 100644 --- a/model/registry/deprecated/db.yaml +++ b/model/registry/deprecated/db.yaml @@ -30,3 +30,9 @@ groups: stability: experimental deprecated: "Replaced by `db.operation.name`." examples: ['findAndModify', 'HMSET', 'SELECT'] + - id: user + type: string + brief: 'Deprecated, no replacement at this time.' + deprecated: "No replacement at this time." + stability: experimental + examples: ['readonly_user', 'reporting_user'] diff --git a/model/trace/database.yaml b/model/trace/database.yaml index 6b0dac762f..5ca47c4f91 100644 --- a/model/trace/database.yaml +++ b/model/trace/database.yaml @@ -5,7 +5,6 @@ groups: attributes: - ref: db.system requirement_level: required - - ref: db.user - ref: db.name requirement_level: conditionally_required: If applicable.