Skip to content

Commit

Permalink
Rename/replace (client|server).socket.(address|port) attributes wit…
Browse files Browse the repository at this point in the history
…h `network.(peer|local).(address|port)`. (#342)

Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
  • Loading branch information
trask and lmolkova authored Oct 10, 2023
1 parent 4040095 commit 0b5a2f3
Show file tree
Hide file tree
Showing 22 changed files with 174 additions and 307 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ release.
([#366](https://github.com/open-telemetry/semantic-conventions/pull/366))
- Add `host.ip` resource attribute convention.
([#203](https://github.com/open-telemetry/semantic-conventions/pull/203))
- BREAKING: Rename/replace `(client|server).socket.(address|port)` attributes
with `network.(peer|local).(address|port)`.
([#342](https://github.com/open-telemetry/semantic-conventions/pull/342))

## v1.21.0 (2023-07-13)

Expand Down
19 changes: 4 additions & 15 deletions docs/database/database-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ Some database systems may allow a connection to switch to a different `db.user`,
| `db.connection_string` | string | The connection string used to connect to the database. It is recommended to remove embedded credentials. | `Server=(localdb)\v11.0;Integrated Security=true;` | Recommended |
| `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` | Required |
| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | Recommended |
| [`network.peer.address`](../general/attributes.md) | string | Peer address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` | Recommended: If different than `server.address`. |
| [`network.peer.port`](../general/attributes.md) | int | Peer port number of the network connection. | `65123` | Recommended: If `network.peer.address` is set. |
| [`network.transport`](../general/attributes.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `udp` | Recommended |
| [`network.type`](../general/attributes.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [2] | `ipv4`; `ipv6` | Recommended |
| [`server.address`](../general/attributes.md) | string | Name of the database host. [3] | `example.com` | Conditionally Required: See alternative attributes below. |
| [`server.port`](../general/attributes.md) | int | Server port number [4] | `80`; `8080`; `443` | Conditionally Required: [5] |
| [`server.socket.address`](../general/attributes.md) | string | Server address of the socket connection - IP address or Unix domain socket name. [6] | `10.5.3.2` | See below |
| [`server.socket.port`](../general/attributes.md) | int | Server port number of the socket connection. [7] | `16456` | Recommended: If different than `server.port`. |
| [`server.address`](../general/attributes.md) | string | Name of the database host. [3] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Recommended |
| [`server.port`](../general/attributes.md) | int | Server port number. [4] | `80`; `8080`; `443` | Conditionally Required: [5] |

**[1]:** The value SHOULD be normalized to lowercase.

Expand All @@ -89,17 +89,6 @@ the server address behind any intermediaries (e.g. proxies) if it's available.

**[5]:** If using a port other than the default port for this DBMS and if `server.address` is set.

**[6]:** When observed from the client side, this SHOULD represent the immediate server peer address.
When observed from the server side, this SHOULD represent the physical server address.

**[7]:** When observed from the client side, this SHOULD represent the immediate server peer port.
When observed from the server side, this SHOULD represent the physical server port.

**Additional attribute requirements:** At least one of the following sets of attributes is required:

* [`server.address`](../general/attributes.md)
* [`server.socket.address`](../general/attributes.md)

`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.

| Value | Description |
Expand Down
4 changes: 2 additions & 2 deletions docs/database/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
| [`db.operation`](database-spans.md) | string | The endpoint identifier for the request. [4] | `search`; `ml.close_job`; `cat.aliases` | Required |
| [`db.statement`](database-spans.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] |
| [`http.request.method`](../attributes-registry/http.md) | string | HTTP request method. [6] | `GET`; `POST`; `HEAD` | Required |
| [`server.address`](../general/attributes.md) | string | Name of the database host. [7] | `example.com` | Conditionally Required: See alternative attributes below. |
| [`server.port`](../general/attributes.md) | int | Server port number [8] | `80`; `8080`; `443` | Conditionally Required: [9] |
| [`server.address`](../general/attributes.md) | string | Name of the database host. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Recommended |
| [`server.port`](../general/attributes.md) | int | Server port number. [8] | `80`; `8080`; `443` | Conditionally Required: [9] |
| [`url.full`](../url/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 |

**[1]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header.
Expand Down
Loading

0 comments on commit 0b5a2f3

Please sign in to comment.