Skip to content

Commit a776eaf

Browse files
authoredApr 8, 2024··
Deprecate db.user (#894)
1 parent 0d2f7de commit a776eaf

File tree

10 files changed

+12
-15
lines changed

10 files changed

+12
-15
lines changed
 

‎.chloggen/894.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: breaking
2+
component: db
3+
note: Deprecate the `db.user` attribute.
4+
issues: [ 885 ]

‎docs/attributes-registry/db.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
| `db.operation.name` | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2828
| `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2929
| `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) |
30-
| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
3130

3231
**[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).
3332

@@ -219,4 +218,5 @@
219218
| `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`. |
220219
| `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. |
221220
| `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`. |
221+
| `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. |
222222
<!-- endsemconv -->

‎docs/database/database-spans.md

-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ with all retries.
6868
## Common attributes
6969

7070
These attributes will usually be the same for all operations performed over the same database connection.
71-
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.
7271

7372
<!-- semconv db(full) -->
7473
| 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`,
7978
| [`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) |
8079
| [`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) |
8180
| [`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) |
82-
| [`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) |
8381
| [`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) |
8482
| [`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) |
8583
| [`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) |

‎docs/database/mongodb.md

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ described on this page.
3131
| :---------------------- | :----------------------------------------------------------- |
3232
| Span name | `"products.findAndModify"` |
3333
| `db.system` | `"mongodb"` |
34-
| `db.user` | `"the_user"` |
3534
| `server.address` | `"mongodb0.example.com"` |
3635
| `server.port` | `27017` |
3736
| `network.peer.address` | `"192.0.2.14"` |

‎docs/database/redis.md

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Furthermore, `db.name` is not specified as there is no database name in Redis an
3838
|:--------------------------| :-------------------------------------------- |
3939
| Span name | `"HMSET myhash"` |
4040
| `db.system` | `"redis"` |
41-
| `db.user` | not set |
4241
| `network.peer.address` | `"/tmp/redis.sock"` |
4342
| `network.transport` | `"unix"` |
4443
| `db.name` | not set |

‎docs/database/sql.md

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ This is an example of attributes for a MySQL database span:
3434
|:------------------------| :----------------------------------------------------------- |
3535
| Span name | `"SELECT ShopDb.orders"` |
3636
| `db.system` | `"mysql"` |
37-
| `db.user` | `"billing_user"` |
3837
| `server.address` | `"shopdb.example.com"` |
3938
| `server.port` | `3306` |
4039
| `network.peer.address` | `"192.0.2.12"` |

‎docs/general/attribute-naming.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Names SHOULD follow these rules:
6060
## Name Pluralization guidelines
6161

6262
- When an attribute represents a single entity, the attribute name SHOULD be
63-
singular. Examples: `host.name`, `db.user`, `container.id`.
63+
singular. Examples: `host.name`, `container.id`.
6464

6565
- When attribute can represent multiple entities, the attribute name SHOULD be
6666
pluralized and the value type SHOULD be an array. E.g. `process.command_args`

‎model/registry/db.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,6 @@ groups:
494494
stability: experimental
495495
stability: experimental
496496
tag: db-generic
497-
- id: user
498-
type: string
499-
stability: experimental
500-
brief: >
501-
Username for accessing the database.
502-
examples: ['readonly_user', 'reporting_user']
503-
tag: db-generic
504497
- id: instance.id
505498
tag: db-generic
506499
type: string

‎model/registry/deprecated/db.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ groups:
3030
stability: experimental
3131
deprecated: "Replaced by `db.operation.name`."
3232
examples: ['findAndModify', 'HMSET', 'SELECT']
33+
- id: user
34+
type: string
35+
brief: 'Deprecated, no replacement at this time.'
36+
deprecated: "No replacement at this time."
37+
stability: experimental
38+
examples: ['readonly_user', 'reporting_user']

‎model/trace/database.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ groups:
55
attributes:
66
- ref: db.system
77
requirement_level: required
8-
- ref: db.user
98
- ref: db.name
109
requirement_level:
1110
conditionally_required: If applicable.

0 commit comments

Comments
 (0)
Please sign in to comment.