Skip to content

Commit

Permalink
Deprecate db.user (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Apr 8, 2024
1 parent 0d2f7de commit a776eaf
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .chloggen/894.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: breaking
component: db
note: Deprecate the `db.user` attribute.
issues: [ 885 ]
2 changes: 1 addition & 1 deletion docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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)<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` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed as not used. |
| `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>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)<br>No replacement at this time. |
<!-- endsemconv -->
2 changes: 0 additions & 2 deletions docs/database/database-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!-- semconv db(full) -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
Expand All @@ -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) |
Expand Down
1 change: 0 additions & 1 deletion docs/database/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` |
Expand Down
1 change: 0 additions & 1 deletion docs/database/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 0 additions & 1 deletion docs/database/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` |
Expand Down
2 changes: 1 addition & 1 deletion docs/general/attribute-naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 0 additions & 7 deletions model/registry/db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions model/registry/deprecated/db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
1 change: 0 additions & 1 deletion model/trace/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ groups:
attributes:
- ref: db.system
requirement_level: required
- ref: db.user
- ref: db.name
requirement_level:
conditionally_required: If applicable.
Expand Down

0 comments on commit a776eaf

Please sign in to comment.