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
note: Remove `network.transport` and `network.type` attributes from database semantic conventions, clarify when `network.peer.address|port` should be populated.
Copy file name to clipboardexpand all lines: docs/database/cassandra.md
+4
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,15 @@ described on this page.
25
25
|[`db.cassandra.speculative_execution_count`](../attributes-registry/db.md)| int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. |`0`; `2`| Recommended |
26
26
|[`db.cassandra.table`](../attributes-registry/db.md)| string | The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). [1]|`mytable`| Recommended |
27
27
|[`db.name`](../attributes-registry/db.md)| string | The keyspace name in Cassandra. [2]|`mykeyspace`| Conditionally Required: If applicable. |
28
+
|[`network.peer.address`](../attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [3]|`10.1.2.80`; `/tmp/my.sock`| Recommended |
29
+
|[`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. |
28
30
29
31
**[1]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
30
32
31
33
**[2]:** For Cassandra the `db.name` should be set to the Cassandra keyspace name.
32
34
35
+
**[3]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
36
+
33
37
`db.cassandra.consistency_level` MUST be one of the following:
Copy file name to clipboardexpand all lines: docs/database/database-spans.md
+9-32
Original file line number
Diff line number
Diff line change
@@ -79,32 +79,25 @@ Some database systems may allow a connection to switch to a different `db.user`,
79
79
|[`db.statement`](../attributes-registry/db.md)| string | The database statement being executed. |`SELECT * FROM wuser_table`; `SET mykey "WuValue"`| Recommended: [3]|
80
80
|[`db.system`](../attributes-registry/db.md)| string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. |`other_sql`| Required |
81
81
|[`db.user`](../attributes-registry/db.md)| string | Username for accessing the database. |`readonly_user`; `reporting_user`| Recommended |
82
-
|[`network.peer.address`](../attributes-registry/network.md)| string | Peer address of the network connection - IP address or Unix domain socket name. |`10.1.2.80`; `/tmp/my.sock`| Recommended |
83
-
|[`network.peer.port`](../attributes-registry/network.md)| int | Peer port number of the network connection. |`65123`| Recommended: If `network.peer.address` is set. |
84
-
|[`network.transport`](../attributes-registry/network.md)| string |[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [4]|`tcp`; `udp`| Recommended |
|[`server.address`](../attributes-registry/server.md)| string | Name of the database host. [6]|`example.com`; `10.1.2.80`; `/tmp/my.sock`| Recommended |
87
-
|[`server.port`](../attributes-registry/server.md)| int | Server port number. [7]|`80`; `8080`; `443`| Conditionally Required: [8]|
82
+
|[`network.peer.address`](../attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [4]|`10.1.2.80`; `/tmp/my.sock`| Recommended: If applicable for this database system. |
83
+
|[`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. |
84
+
|[`server.address`](../attributes-registry/server.md)| string | Name of the database host. [5]|`example.com`; `10.1.2.80`; `/tmp/my.sock`| Recommended |
85
+
|[`server.port`](../attributes-registry/server.md)| int | Server port number. [6]|`80`; `8080`; `443`| Conditionally Required: [7]|
88
86
89
87
**[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).
90
88
91
89
**[2]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.
92
90
93
91
**[3]:** Should be collected by default only if there is sanitization that excludes sensitive information.
94
92
95
-
**[4]:** The value SHOULD be normalized to lowercase.
93
+
**[4]:** 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.
94
+
If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
96
95
97
-
Consider always setting the transport when setting a port number, since
98
-
a port number is ambiguous without knowing the transport. For example
99
-
different processes could be listening on TCP port 12345 and UDP port 12345.
96
+
**[5]:** 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.
100
97
101
-
**[5]:**The value SHOULD be normalized to lowercase.
98
+
**[6]:**When observed from the client side, and when communicating through an intermediary, `server.port`SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
102
99
103
-
**[6]:** 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.
104
-
105
-
**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
106
-
107
-
**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
100
+
**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set.
108
101
109
102
`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.
110
103
@@ -162,22 +155,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345.
162
155
|`clickhouse`| ClickHouse |
163
156
|`spanner`| Cloud Spanner |
164
157
|`trino`| Trino |
165
-
166
-
`network.transport` 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.
167
-
168
-
| Value | Description |
169
-
|---|---|
170
-
|`tcp`| TCP |
171
-
|`udp`| UDP |
172
-
|`pipe`| Named or anonymous pipe. |
173
-
|`unix`| Unix domain socket |
174
-
175
-
`network.type` 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.
176
-
177
-
| Value | Description |
178
-
|---|---|
179
-
|`ipv4`| IPv4 |
180
-
|`ipv6`| IPv6 |
181
158
<!-- endsemconv -->
182
159
183
160
### Notes and well-known identifiers for `db.system`
Copy file name to clipboardexpand all lines: docs/database/elasticsearch.md
+11-7
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,11 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
32
32
|[`db.operation`](../attributes-registry/db.md)| string | The endpoint identifier for the request. [4]|`search`; `ml.close_job`; `cat.aliases`| Required |
33
33
|[`db.statement`](../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: [5]|
|[`server.address`](../attributes-registry/server.md)| string | Name of the database host. [7]|`example.com`; `10.1.2.80`; `/tmp/my.sock`| Recommended |
36
-
|[`server.port`](../attributes-registry/server.md)| int | Server port number. [8]|`80`; `8080`; `443`| Conditionally Required: [9]|
37
-
|[`url.full`](../attributes-registry/url.md)| string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)[10]|`https://localhost:9200/index/_search?q=user.id:kimchy`| Required |
35
+
|[`network.peer.address`](../attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [7]|`10.1.2.80`; `/tmp/my.sock`| Recommended |
36
+
|[`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. |
37
+
|[`server.address`](../attributes-registry/server.md)| string | Name of the database host. [8]|`example.com`; `10.1.2.80`; `/tmp/my.sock`| Recommended |
38
+
|[`server.port`](../attributes-registry/server.md)| int | Server port number. [9]|`80`; `8080`; `443`| Conditionally Required: [10]|
39
+
|[`url.full`](../attributes-registry/url.md)| string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)[11]|`https://localhost:9200/index/_search?q=user.id:kimchy`| Required |
38
40
39
41
**[1]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header.
40
42
@@ -61,13 +63,15 @@ HTTP method names are case-sensitive and `http.request.method` attribute value M
61
63
Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.
62
64
Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.
63
65
64
-
**[7]:**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.
66
+
**[7]:**If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
65
67
66
-
**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
68
+
**[8]:** 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.
67
69
68
-
**[9]:**If using a port other than the default port for this DBMS and if `server.address` is set.
70
+
**[9]:**When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
69
71
70
-
**[10]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.
72
+
**[10]:** If using a port other than the default port for this DBMS and if `server.address` is set.
73
+
74
+
**[11]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.
71
75
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.
72
76
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it.
Copy file name to clipboardexpand all lines: docs/database/redis.md
+4
Original file line number
Diff line number
Diff line change
@@ -19,10 +19,14 @@ described on this page.
19
19
|---|---|---|---|---|
20
20
|[`db.redis.database_index`](../attributes-registry/db.md)| int | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. |`0`; `1`; `15`| Conditionally Required: If other than the default database (`0`). |
21
21
|[`db.statement`](../attributes-registry/db.md)| string | The full syntax of the Redis CLI command. [1]|`HMSET myhash field1 'Hello' field2 'World'`| Recommended: [2]|
22
+
|[`network.peer.address`](../attributes-registry/network.md)| string | Peer address of the database node where the operation was performed. [3]|`10.1.2.80`; `/tmp/my.sock`| Recommended |
23
+
|[`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. |
22
24
23
25
**[1]:** For **Redis**, the value provided for `db.statement` 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.statement`.
24
26
25
27
**[2]:** Should be collected by default only if there is sanitization that excludes sensitive information.
28
+
29
+
**[3]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.
0 commit comments