From 998ed2f965652972c19d217dd96e36a734b9ea6a Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 5 Apr 2024 07:35:07 -0700 Subject: [PATCH 1/2] Remove db.user --- docs/attributes-registry/db.md | 3 ++- docs/database/database-spans.md | 2 -- docs/database/mongodb.md | 1 - docs/database/redis.md | 1 - docs/database/sql.md | 1 - docs/general/attribute-naming.md | 2 +- model/registry/db.yaml | 7 ------- model/registry/deprecated/db.yaml | 6 ++++++ model/trace/database.yaml | 1 - 9 files changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 63824a6024..4d24d14a08 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -28,7 +28,6 @@ | `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` | ![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). @@ -221,6 +220,7 @@ | `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
"Replaced by `server.address` and `server.port`." | | `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.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. | ### Deprecated Elasticsearch Attributes @@ -231,4 +231,5 @@ | `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
"Replaced by `server.address` and `server.port`." | | `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.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 972635b38d..5f8431937d 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 c733f4ffb0..f9f851bd64 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -26,7 +26,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 1357ac2003..8b9e67b02d 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -28,7 +28,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 f56a830fcb..98c00c3d9b 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -502,13 +502,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 c2f94cfe22..f8441cad9a 100644 --- a/model/registry/deprecated/db.yaml +++ b/model/registry/deprecated/db.yaml @@ -24,3 +24,9 @@ groups: deprecated: "Replaced by `db.instance.id`." stability: experimental examples: ["instance-0000000001"] + - 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 7435d4e485..a2d52d3278 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. From 03f5816204e9994611aa0af8c1d692b83ccf4fc2 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 5 Apr 2024 07:37:44 -0700 Subject: [PATCH 2/2] chlog --- .chloggen/894.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .chloggen/894.yaml 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 ]