You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/database/database-spans.md
+11-8
Original file line number
Diff line number
Diff line change
@@ -91,11 +91,11 @@ These attributes will usually be the same for all operations performed over the
91
91
|[`db.operation.name`](/docs/attributes-registry/db.md)| string | The name of the operation or command being executed. |`findAndModify`; `HMSET`; `SELECT`|`Conditionally Required`[4]||
92
92
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [5]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` If and only if the operation failed. ||
93
93
|[`server.port`](/docs/attributes-registry/server.md)| int | Server port number. [6]|`80`; `8080`; `443`|`Conditionally Required`[7]||
94
-
|[`db.query.text`](/docs/attributes-registry/db.md)| string | The database query being executed. |`SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"`|`Recommended`[8]||
95
-
|[`network.peer.address`](/docs/attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [9]|`10.1.2.80`; `/tmp/my.sock`|`Recommended` If applicable for this database system. ||
94
+
|[`db.query.text`](/docs/attributes-registry/db.md)| string | The database query being executed. [8]|`SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"`|`Recommended`[9]||
95
+
|[`network.peer.address`](/docs/attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [10]|`10.1.2.80`; `/tmp/my.sock`|`Recommended` If applicable for this database system. ||
96
96
|[`network.peer.port`](/docs/attributes-registry/network.md)| int | Peer port number of the network connection. |`65123`|`Recommended` if and only if `network.peer.address` is set. ||
97
-
|[`server.address`](/docs/attributes-registry/server.md)| string | Name of the database host. [10]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
98
-
|[`db.query.parameter.<key>`](/docs/attributes-registry/db.md)| string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [11]|`someval`; `55`|`Opt-In`||
97
+
|[`server.address`](/docs/attributes-registry/server.md)| string | Name of the database host. [11]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
98
+
|[`db.query.parameter.<key>`](/docs/attributes-registry/db.md)| string | The query parameters used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being the parameter value. [12]|`someval`; `55`|`Opt-In`||
99
99
100
100
**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name.
101
101
@@ -112,14 +112,17 @@ Semantic conventions for individual database systems SHOULD document what `db.na
112
112
113
113
**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set.
114
114
115
-
**[8]:**SHOULD be collected by default only if there is sanitization that excludes sensitive information.
115
+
**[8]:**Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.
116
116
117
-
**[9]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly.
117
+
**[9]:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text.
118
+
Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.query.parameter.<key>`](../../docs/attributes-registry/db.md)).
119
+
120
+
**[10]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly.
118
121
If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
119
122
120
-
**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
123
+
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
121
124
122
-
**[11]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
125
+
**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
123
126
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
124
127
125
128
`db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Copy file name to clipboardExpand all lines: docs/database/elasticsearch.md
+8-6
Original file line number
Diff line number
Diff line change
@@ -33,10 +33,10 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
33
33
|[`server.port`](/docs/attributes-registry/server.md)| int | Server port number. [5]|`80`; `8080`; `443`|`Conditionally Required`[6]||
34
34
|[`db.elasticsearch.cluster.name`](/docs/attributes-registry/db.md)| string | Represents the identifier of an Elasticsearch cluster. |`e9106fc68e3044f0b1475b04bf4ffd5f`|`Recommended`[7]||
35
35
|[`db.elasticsearch.node.name`](/docs/attributes-registry/db.md)| string | Represents the human-readable identifier of the node/instance to which a request was routed. |`instance-0000000001`|`Recommended`[8]||
36
-
|[`db.query.text`](/docs/attributes-registry/db.md)| string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. |`"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"`|`Recommended`[9]||
37
-
|[`network.peer.address`](/docs/attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [10]|`10.1.2.80`; `/tmp/my.sock`|`Recommended`||
36
+
|[`db.query.text`](/docs/attributes-registry/db.md)| string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. [9]|`"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"`|`Recommended`[10]||
37
+
|[`network.peer.address`](/docs/attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [11]|`10.1.2.80`; `/tmp/my.sock`|`Recommended`||
38
38
|[`network.peer.port`](/docs/attributes-registry/network.md)| int | Peer port number of the network connection. |`65123`|`Recommended` if and only if `network.peer.address` is set. ||
39
-
|[`server.address`](/docs/attributes-registry/server.md)| string | Name of the database host. [11]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
39
+
|[`server.address`](/docs/attributes-registry/server.md)| string | Name of the database host. [12]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
40
40
41
41
**[1]:** This SHOULD be the endpoint identifier for the request.
42
42
@@ -69,11 +69,13 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original
69
69
70
70
**[8]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.
71
71
72
-
**[9]:**Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.
72
+
**[9]:**Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.
73
73
74
-
**[10]:**If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
74
+
**[10]:**Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.
75
75
76
-
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
76
+
**[11]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
77
+
78
+
**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
77
79
78
80
`http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Copy file name to clipboardExpand all lines: docs/database/redis.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,8 @@ For commands that switch the database, this SHOULD be set to the target database
28
28
29
29
**[2]:** For **Redis**, the value provided for `db.query.text` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.query.text`.
30
30
31
-
**[3]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information.
31
+
**[3]:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text.
32
+
Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.query.parameter.<key>`](../../docs/attributes-registry/db.md)).
32
33
33
34
**[4]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
0 commit comments