Skip to content

Commit

Permalink
Remove db.user
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Apr 5, 2024
1 parent 1210132 commit 998ed2f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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)<br>"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)<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.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 -->

### Deprecated Elasticsearch Attributes
Expand All @@ -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)<br>"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)<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.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 @@ -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"` |
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 @@ -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"` |
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 @@ -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
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 @@ -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']
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 998ed2f

Please sign in to comment.