From a4502725126075375fd631d8bbd5e9cd42415dc9 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 6 Feb 2024 18:06:43 -0800 Subject: [PATCH 01/12] Remove network attributes from messaging and database semconv --- docs/messaging/messaging-metrics.md | 16 +++------ docs/messaging/messaging-spans.md | 54 +++-------------------------- model/messaging-common.yaml | 7 +--- model/trace/messaging.yaml | 6 ---- 4 files changed, 9 insertions(+), 74 deletions(-) diff --git a/docs/messaging/messaging-metrics.md b/docs/messaging/messaging-metrics.md index f650cfd9bf..b53c98e9a7 100644 --- a/docs/messaging/messaging-metrics.md +++ b/docs/messaging/messaging-metrics.md @@ -36,10 +36,8 @@ All messaging metrics share the same set of attributes: | [`messaging.destination.name`](../attributes-registry/messaging.md) | string | The message destination name [3] | `MyQueue`; `MyTopic` | Conditionally Required: [4] | | [`messaging.destination.template`](../attributes-registry/messaging.md) | string | Low cardinality representation of the messaging destination name [5] | `/customers/{customerId}` | Conditionally Required: if available. | | [`messaging.system`](../attributes-registry/messaging.md) | string | An identifier for the messaging system being used. See below for a list of well-known identifiers. | `activemq` | Required | -| [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [6] | `amqp`; `mqtt` | Conditionally Required: [7] | -| [`network.protocol.version`](../attributes-registry/network.md) | string | Version of the protocol specified in `network.protocol.name`. [8] | `3.1.1` | Recommended | -| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [10] | `80`; `8080`; `443` | Recommended | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [6] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | Recommended | **[1]:** The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. @@ -66,15 +64,9 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[5]:** Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. -**[6]:** The value SHOULD be normalized to lowercase. +**[6]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[7]:** Only for messaging systems and frameworks that support more than one protocol. - -**[8]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - -**[9]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. - -**[10]:** 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. +**[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. `error.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. diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index 7cff828c2c..e76da06d3a 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -275,8 +275,6 @@ Messaging attributes are organized into the following namespaces: - `messaging.batch`: Contains attributes that describe batch operations. - `messaging.consumer`: Contains [consumer attributes](#consumer-attributes) that describe the application instance that consumes a message. See [consumer](#consumer) for more details. -The communication with the intermediary is described with general [network attributes]. - Messaging system-specific attributes MUST be defined in the corresponding `messaging.{system}` namespace as described in [Attributes specific to certain messaging systems](#attributes-specific-to-certain-messaging-systems). @@ -296,14 +294,8 @@ as described in [Attributes specific to certain messaging systems](#attributes-s | [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | | [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [13] | `publish` | Required | | [`messaging.system`](../attributes-registry/messaging.md) | string | An identifier for the messaging system being used. See below for a list of well-known identifiers. | `activemq` | Required | -| [`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 | -| [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended: If `network.peer.address` is set. | -| [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [14] | `amqp`; `mqtt` | Conditionally Required: [15] | -| [`network.protocol.version`](../attributes-registry/network.md) | string | Version of the protocol specified in `network.protocol.name`. [16] | `3.1.1` | Recommended | -| [`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). [17] | `tcp`; `udp` | Recommended | -| [`network.type`](../attributes-registry/network.md) | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. [18] | `ipv4`; `ipv6` | Recommended | -| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [19] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [20] | `80`; `8080`; `443` | Recommended | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [14] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [15] | `80`; `8080`; `443` | Recommended | **[1]:** The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. @@ -348,23 +340,9 @@ size should be used. **[13]:** If a custom value is used, it MUST be of low cardinality. -**[14]:** The value SHOULD be normalized to lowercase. - -**[15]:** Only for messaging systems and frameworks that support more than one protocol. - -**[16]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - -**[17]:** The value SHOULD be normalized to lowercase. - -Consider always setting the transport when setting a port number, since -a port number is ambiguous without knowing the transport. For example -different processes could be listening on TCP port 12345 and UDP port 12345. +**[14]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[18]:** The value SHOULD be normalized to lowercase. - -**[19]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. - -**[20]:** 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. +**[15]:** 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. `error.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. @@ -396,32 +374,8 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `kafka` | Apache Kafka | | `rabbitmq` | RabbitMQ | | `rocketmq` | Apache RocketMQ | - -`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. - -| Value | Description | -|---|---| -| `tcp` | TCP | -| `udp` | UDP | -| `pipe` | Named or anonymous pipe. | -| `unix` | Unix domain socket | - -`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. - -| Value | Description | -|---|---| -| `ipv4` | IPv4 | -| `ipv6` | IPv6 | -Additionally `server.port` from the [network attributes][] is recommended. -Furthermore, it is strongly recommended to add the [`network.transport`][] attribute and follow its guidelines, especially for in-process queueing systems (like [Hangfire][], for example). -These attributes should be set to the broker to which the message is sent/from which it is received. - -[network attributes]: /docs/general/attributes.md#server-and-client-attributes -[`network.transport`]: /docs/general/attributes.md#network-attributes -[Hangfire]: https://www.hangfire.io/ - ### Consumer attributes The following additional attributes describe message consumer operations. diff --git a/model/messaging-common.yaml b/model/messaging-common.yaml index f5505a0baf..35d6a8eefb 100644 --- a/model/messaging-common.yaml +++ b/model/messaging-common.yaml @@ -12,12 +12,7 @@ groups: conditionally_required: If and only if the messaging operation has failed. - ref: server.address note: > - This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. + Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. requirement_level: conditionally_required: If available. - ref: server.port - - ref: network.protocol.name - examples: ['amqp', 'mqtt'] - requirement_level: - conditionally_required: Only for messaging systems and frameworks that support more than one protocol. - - ref: network.protocol.version diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 362eaab9f4..1e04f6d602 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -81,12 +81,6 @@ groups: - ref: messaging.message.envelope.size - ref: messaging.message.body.size - ref: server.address - - ref: network.peer.address - - ref: network.peer.port - requirement_level: - recommended: If `network.peer.address` is set. - - ref: network.transport - - ref: network.type - id: messaging.rabbitmq type: attribute_group From 7c7d25550b1b3a97d9fbaf67ba244bba7a064a64 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 6 Feb 2024 18:10:06 -0800 Subject: [PATCH 02/12] changelog --- .chloggen/698.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chloggen/698.yaml diff --git a/.chloggen/698.yaml b/.chloggen/698.yaml new file mode 100644 index 0000000000..4b97b77899 --- /dev/null +++ b/.chloggen/698.yaml @@ -0,0 +1,7 @@ +change_type: breaking + +component: messaging + +note: Remove `network.*` attributes from general messaging and database semantic conventions. + +issues: [690, 698] From de4d0f37a53da127f7eddde2aa0c33e83550f5a0 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 14 Feb 2024 21:59:04 -0800 Subject: [PATCH 03/12] remove network from db examples --- docs/database/mongodb.md | 3 --- docs/database/redis.md | 3 +-- docs/database/sql.md | 3 --- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index 71558732c8..e30d5052df 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -29,9 +29,6 @@ described on this page. | `db.user` | `"the_user"` | | `server.address` | `"mongodb0.example.com"` | | `server.port` | `27017` | -| `network.peer.address` | `"192.0.2.14"` | -| `network.peer.port` | `27017` | -| `network.transport` | `"tcp"` | | `db.name` | `"shopDb"` | | `db.statement` | not set | | `db.operation` | `"findAndModify"` | diff --git a/docs/database/redis.md b/docs/database/redis.md index 895a293895..158fff9f34 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -39,8 +39,7 @@ 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"` | +| `server.address` | `"/tmp/redis.sock"` | | `db.name` | not set | | `db.statement` | `"HMSET myhash field1 'Hello' field2 'World"` | | `db.operation` | not set | diff --git a/docs/database/sql.md b/docs/database/sql.md index 17b8dcc892..014bcb9433 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -31,9 +31,6 @@ This is an example of attributes for a MySQL database span: | `db.user` | `"billing_user"` | | `server.address` | `"shopdb.example.com"` | | `server.port` | `3306` | -| `network.peer.address` | `"192.0.2.12"` | -| `network.peer.port` | `3306` | -| `network.transport` | `"tcp"` | | `db.name` | `"ShopDb"` | | `db.statement` | `"SELECT * FROM orders WHERE order_id = 'o4711'"` | | `db.operation` | `"SELECT"` | From ccc80e4d873f0e8d95102e980cb39c9b5466111a Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 23 Feb 2024 15:01:23 -0800 Subject: [PATCH 04/12] limit to messaging --- .chloggen/698.yaml | 2 +- docs/database/mongodb.md | 3 +++ docs/database/redis.md | 3 ++- docs/database/sql.md | 3 +++ docs/messaging/rabbitmq.md | 2 ++ model/trace/messaging.yaml | 4 ++++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.chloggen/698.yaml b/.chloggen/698.yaml index 4b97b77899..27cc4211e4 100644 --- a/.chloggen/698.yaml +++ b/.chloggen/698.yaml @@ -2,6 +2,6 @@ change_type: breaking component: messaging -note: Remove `network.*` attributes from general messaging and database semantic conventions. +note: Remove `network.*` attributes from general messaging semantic conventions. issues: [690, 698] diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index e30d5052df..71558732c8 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -29,6 +29,9 @@ described on this page. | `db.user` | `"the_user"` | | `server.address` | `"mongodb0.example.com"` | | `server.port` | `27017` | +| `network.peer.address` | `"192.0.2.14"` | +| `network.peer.port` | `27017` | +| `network.transport` | `"tcp"` | | `db.name` | `"shopDb"` | | `db.statement` | not set | | `db.operation` | `"findAndModify"` | diff --git a/docs/database/redis.md b/docs/database/redis.md index 158fff9f34..895a293895 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -39,7 +39,8 @@ 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 | -| `server.address` | `"/tmp/redis.sock"` | +| `network.peer.address` | `"/tmp/redis.sock"` | +| `network.transport` | `"unix"` | | `db.name` | not set | | `db.statement` | `"HMSET myhash field1 'Hello' field2 'World"` | | `db.operation` | not set | diff --git a/docs/database/sql.md b/docs/database/sql.md index 014bcb9433..17b8dcc892 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -31,6 +31,9 @@ This is an example of attributes for a MySQL database span: | `db.user` | `"billing_user"` | | `server.address` | `"shopdb.example.com"` | | `server.port` | `3306` | +| `network.peer.address` | `"192.0.2.12"` | +| `network.peer.port` | `3306` | +| `network.transport` | `"tcp"` | | `db.name` | `"ShopDb"` | | `db.statement` | `"SELECT * FROM orders WHERE order_id = 'o4711'"` | | `db.operation` | `"SELECT"` | diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 1c8f2ec8cc..135d3b21ad 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -22,6 +22,8 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. |---|---|---|---|---| | [`messaging.rabbitmq.destination.routing_key`](../attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. | | [`messaging.rabbitmq.message.delivery_tag`](../attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | Conditionally Required: When available. | +| [`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 | +| [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 1e04f6d602..4884b437f8 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -96,6 +96,10 @@ groups: requirement_level: conditionally_required: When available. tag: tech-specific-rabbitmq + - ref: network.peer.address + tag: tech-specific-rabbitmq + - ref: network.peer.port + tag: tech-specific-rabbitmq - id: messaging.kafka type: attribute_group From ab8959a57b88c025eea2599409fc03338beacf0e Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 23 Feb 2024 15:52:44 -0800 Subject: [PATCH 05/12] update network description --- docs/messaging/rabbitmq.md | 4 +++- model/trace/messaging.yaml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 135d3b21ad..4f9287debe 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -22,8 +22,10 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. |---|---|---|---|---| | [`messaging.rabbitmq.destination.routing_key`](../attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. | | [`messaging.rabbitmq.message.delivery_tag`](../attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | Conditionally Required: When available. | -| [`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 | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended | + +**[1]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 4884b437f8..6fbc390a84 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -97,6 +97,9 @@ groups: conditionally_required: When available. tag: tech-specific-rabbitmq - ref: network.peer.address + note: > + If a database operation involved multiple network calls (for example retries), + the address of the last contacted node SHOULD be used. tag: tech-specific-rabbitmq - ref: network.peer.port tag: tech-specific-rabbitmq From a5698829c7f321250fca4d9290d6522b02b38a95 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 1 Mar 2024 16:02:32 -0800 Subject: [PATCH 06/12] rebase and fix rabbitmq network note --- docs/messaging/rabbitmq.md | 2 +- model/trace/messaging.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 4f9287debe..e2501f0e60 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -25,7 +25,7 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended | -**[1]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[1]:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 6fbc390a84..5d2deb5fbe 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -98,7 +98,7 @@ groups: tag: tech-specific-rabbitmq - ref: network.peer.address note: > - If a database operation involved multiple network calls (for example retries), + If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. tag: tech-specific-rabbitmq - ref: network.peer.port From e33c44b9bcd6f9936ad880ca879fbf08193e6057 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 8 Mar 2024 16:11:53 -0800 Subject: [PATCH 07/12] Bring network.peer.* back to general messaging, clarify when to set them --- .chloggen/698.yaml | 2 +- docs/messaging/gcp-pubsub.md | 4 +- docs/messaging/kafka.md | 2 +- docs/messaging/messaging-spans.md | 14 +++++-- docs/messaging/rabbitmq.md | 4 +- docs/messaging/rocketmq.md | 2 +- model/trace/messaging.yaml | 66 +++++++++++++++++++++---------- 7 files changed, 63 insertions(+), 31 deletions(-) diff --git a/.chloggen/698.yaml b/.chloggen/698.yaml index 27cc4211e4..c12d9d9f2d 100644 --- a/.chloggen/698.yaml +++ b/.chloggen/698.yaml @@ -2,6 +2,6 @@ change_type: breaking component: messaging -note: Remove `network.*` attributes from general messaging semantic conventions. +note: Remove `network.transport` and `network.type` attributes from messaging semantic conventions, clarify when `network.peer.address|port` should be populated. issues: [690, 698] diff --git a/docs/messaging/gcp-pubsub.md b/docs/messaging/gcp-pubsub.md index 95acf97d64..17b74081a9 100644 --- a/docs/messaging/gcp-pubsub.md +++ b/docs/messaging/gcp-pubsub.md @@ -13,7 +13,7 @@ The Semantic Conventions for [Google Cloud Pub/Sub](https://cloud.google.com/pub ## Span attributes For Google Cloud Pub/Sub, the following additional attributes are defined: - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`messaging.gcp_pubsub.message.ordering_key`](../attributes-registry/messaging.md) | string | The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. | `ordering_key` | Conditionally Required: If the message type has an ordering key set. | @@ -31,7 +31,7 @@ flowchart LR; direction LR CA[Span Create A] CB[Span Create B] - P[Span Publish A B] + P[Span Publish A B] end CA-. link .-P; CB-. link .-P; diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index 4f6866ed83..522c4c2a16 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -24,7 +24,7 @@ described on this page. For Apache Kafka, the following additional attributes are defined: - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`messaging.destination.partition.id`](../attributes-registry/messaging.md) | string | "String representation of the partition id the message (or batch) is sent to or received from."" | `1` | Recommended | diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index e76da06d3a..655770bd71 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -294,8 +294,10 @@ as described in [Attributes specific to certain messaging systems](#attributes-s | [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | | [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [13] | `publish` | Required | | [`messaging.system`](../attributes-registry/messaging.md) | string | An identifier for the messaging system being used. See below for a list of well-known identifiers. | `activemq` | Required | -| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [14] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [15] | `80`; `8080`; `443` | Recommended | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node operation was performed on. [14] | `10.1.2.80`; `/tmp/my.sock` | Recommended: [15] | +| [`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. | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [16] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [17] | `80`; `8080`; `443` | Recommended | **[1]:** The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. @@ -340,9 +342,13 @@ size should be used. **[13]:** If a custom value is used, it MUST be of low cardinality. -**[14]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +**[14]:** Network peer address and port are important when the application interacts with individual intermediary nodes directly, for example, when messaging intermediary is self-hosted. Fully managed messaging systems that don't expose information about individual nodes SHOULD NOT set this attribute. Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes should be captured. If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[15]:** 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. +**[15]:** If available and known to represent the address of specific intermediary node. + +**[16]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + +**[17]:** 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. `error.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. diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index e2501f0e60..e2d1b095ca 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -17,12 +17,12 @@ described on this page. In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. `messaging.destination.name` MUST be set to the name of the exchange. This will be an empty string if the default exchange is used. - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`messaging.rabbitmq.destination.routing_key`](../attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. | | [`messaging.rabbitmq.message.delivery_tag`](../attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | Conditionally Required: When available. | -| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node operation was performed on. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended | **[1]:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. diff --git a/docs/messaging/rocketmq.md b/docs/messaging/rocketmq.md index 8f4bbca5fb..eb0d8b3d5d 100644 --- a/docs/messaging/rocketmq.md +++ b/docs/messaging/rocketmq.md @@ -16,7 +16,7 @@ described on this page. Specific attributes for Apache RocketMQ are defined below. - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`messaging.rocketmq.client_group`](../attributes-registry/messaging.md) | string | Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. | `myConsumerGroup` | Required | diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 5d2deb5fbe..3d4127785a 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -80,29 +80,55 @@ groups: - ref: messaging.message.conversation_id - ref: messaging.message.envelope.size - ref: messaging.message.body.size - - ref: server.address + - ref: network.peer.address + brief: Peer address of the messaging intermediary node operation was performed on. + requirement_level: + recommended: If available and known to represent the address of specific intermediary node. + note: > + Network peer address and port are important when the application interacts with individual intermediary nodes directly, + for example, when messaging intermediary is self-hosted. + Fully managed messaging systems that don't expose information about individual nodes SHOULD NOT set this attribute. + Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes should be captured. + If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. + - ref: network.peer.port + requirement_level: + recommended: if and only if `network.peer.address` is set. - - id: messaging.rabbitmq + - id: messaging.tech_specific.network.attributes type: attribute_group + brief: Attributes that describe messaging operation along with network information. extends: messaging + attributes: + - ref: network.peer.address + requirement_level: recommended + note: > + If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. + tag: tech-specific + - ref: network.peer.port + requirement_level: recommended + tag: tech-specific + + - id: messaging.rabbitmq + type: attribute_group + extends: messaging.tech_specific.network.attributes brief: > Attributes for RabbitMQ attributes: - ref: messaging.rabbitmq.destination.routing_key requirement_level: conditionally_required: If not empty. - tag: tech-specific-rabbitmq + tag: tech-specific - ref: messaging.rabbitmq.message.delivery_tag requirement_level: conditionally_required: When available. - tag: tech-specific-rabbitmq + tag: tech-specific - ref: network.peer.address note: > If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - tag: tech-specific-rabbitmq + tag: tech-specific - ref: network.peer.port - tag: tech-specific-rabbitmq + tag: tech-specific - id: messaging.kafka type: attribute_group @@ -115,15 +141,15 @@ groups: "String representation of the partition id the message (or batch) is sent to or received from."" tag: tech-specific-kafka - ref: messaging.kafka.message.key - tag: tech-specific-kafka + tag: tech-specific - ref: messaging.kafka.consumer.group - tag: tech-specific-kafka + tag: tech-specific - ref: messaging.kafka.message.offset - tag: tech-specific-kafka + tag: tech-specific - ref: messaging.kafka.message.tombstone requirement_level: conditionally_required: If value is `true`. When missing, the value is assumed to be `false`. - tag: tech-specific-kafka + tag: tech-specific - id: messaging.rocketmq type: attribute_group @@ -133,30 +159,30 @@ groups: attributes: - ref: messaging.rocketmq.namespace requirement_level: required - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.client_group requirement_level: required - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.message.delivery_timestamp requirement_level: conditionally_required: If the message type is delay and delay time level is not specified. - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.message.delay_time_level requirement_level: conditionally_required: If the message type is delay and delivery timestamp is not specified. - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.message.group requirement_level: conditionally_required: If the message type is FIFO. - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.message.type - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.message.tag - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.message.keys - tag: tech-specific-rocketmq + tag: tech-specific - ref: messaging.rocketmq.consumption_model - tag: tech-specific-rocketmq + tag: tech-specific - id: messaging.gcp_pubsub type: attribute_group extends: messaging @@ -164,7 +190,7 @@ groups: Attributes for Google Cloud Pub/Sub attributes: - ref: messaging.gcp_pubsub.message.ordering_key - tag: tech-specific-gcp-pubsub + tag: tech-specific requirement_level: conditionally_required: If the message type has an ordering key set. - id: messaging.servicebus From 2f22b9e3a022e03abc62448237f4140d31b290f6 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 11 Mar 2024 11:43:42 -0700 Subject: [PATCH 08/12] review feedback --- docs/messaging/messaging-spans.md | 17 +++++++++-------- model/trace/messaging.yaml | 9 ++++++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index 655770bd71..a3955ebefe 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -294,10 +294,10 @@ as described in [Attributes specific to certain messaging systems](#attributes-s | [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | | [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [13] | `publish` | Required | | [`messaging.system`](../attributes-registry/messaging.md) | string | An identifier for the messaging system being used. See below for a list of well-known identifiers. | `activemq` | Required | -| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node operation was performed on. [14] | `10.1.2.80`; `/tmp/my.sock` | Recommended: [15] | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node operation was performed on. [14] | `10.1.2.80`; `/tmp/my.sock` | Recommended: If applicable for this messaging system. | | [`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. | -| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [16] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [17] | `80`; `8080`; `443` | Recommended | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [16] | `80`; `8080`; `443` | Recommended | **[1]:** The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. @@ -342,13 +342,14 @@ size should be used. **[13]:** If a custom value is used, it MUST be of low cardinality. -**[14]:** Network peer address and port are important when the application interacts with individual intermediary nodes directly, for example, when messaging intermediary is self-hosted. Fully managed messaging systems that don't expose information about individual nodes SHOULD NOT set this attribute. Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes should be captured. If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[14]:** Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. +Network peer address and port are important when the application interacts with individual intermediary nodes directly, for example, when messaging intermediary is self-hosted. +Instrumentations for messaging systems that don't provide self-hosted mode SHOULD NOT set this attribute. +If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[15]:** If available and known to represent the address of specific intermediary node. +**[15]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[16]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - -**[17]:** 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. +**[16]:** 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. `error.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. diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 3d4127785a..a6ef5d92a6 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -83,12 +83,15 @@ groups: - ref: network.peer.address brief: Peer address of the messaging intermediary node operation was performed on. requirement_level: - recommended: If available and known to represent the address of specific intermediary node. + recommended: If applicable for this messaging system. note: > + Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. + Network peer address and port are important when the application interacts with individual intermediary nodes directly, for example, when messaging intermediary is self-hosted. - Fully managed messaging systems that don't expose information about individual nodes SHOULD NOT set this attribute. - Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes should be captured. + + Instrumentations for messaging systems that don't provide self-hosted mode SHOULD NOT set this attribute. + If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - ref: network.peer.port requirement_level: From 56bb38df8bdd3a7ca142b5b013f2662e431f82a0 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 13 Mar 2024 14:58:01 -0700 Subject: [PATCH 09/12] up --- docs/messaging/kafka.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index 522c4c2a16..742dfc621a 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -27,7 +27,6 @@ For Apache Kafka, the following additional attributes are defined: | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| [`messaging.destination.partition.id`](../attributes-registry/messaging.md) | string | "String representation of the partition id the message (or batch) is sent to or received from."" | `1` | Recommended | | [`messaging.kafka.consumer.group`](../attributes-registry/messaging.md) | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` | Recommended | | [`messaging.kafka.message.key`](../attributes-registry/messaging.md) | string | Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. [1] | `myKey` | Recommended | | [`messaging.kafka.message.offset`](../attributes-registry/messaging.md) | int | The offset of a record in the corresponding Kafka partition. | `42` | Recommended | From 070b2617f5f6969367d94add3b4950cc69eb761b Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 14 Mar 2024 15:17:11 -0700 Subject: [PATCH 10/12] sync with suggested changes on the db semconv --- docs/messaging/messaging-spans.md | 5 ++--- docs/messaging/rabbitmq.md | 2 +- model/trace/messaging.yaml | 7 ++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index a3955ebefe..e4cc45f60d 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -294,7 +294,7 @@ as described in [Attributes specific to certain messaging systems](#attributes-s | [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | | [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [13] | `publish` | Required | | [`messaging.system`](../attributes-registry/messaging.md) | string | An identifier for the messaging system being used. See below for a list of well-known identifiers. | `activemq` | Required | -| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node operation was performed on. [14] | `10.1.2.80`; `/tmp/my.sock` | Recommended: If applicable for this messaging system. | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node where the operation was performed. [14] | `10.1.2.80`; `/tmp/my.sock` | Recommended: If applicable for this messaging system. | | [`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. | | [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | | [`server.port`](../attributes-registry/server.md) | int | Server port number. [16] | `80`; `8080`; `443` | Recommended | @@ -343,8 +343,7 @@ size should be used. **[13]:** If a custom value is used, it MUST be of low cardinality. **[14]:** Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. -Network peer address and port are important when the application interacts with individual intermediary nodes directly, for example, when messaging intermediary is self-hosted. -Instrumentations for messaging systems that don't provide self-hosted mode SHOULD NOT set this attribute. +Network peer address and port are important when the application interacts with individual intermediary nodes directly If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. **[15]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index e2d1b095ca..362fd162a8 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -22,7 +22,7 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. |---|---|---|---|---| | [`messaging.rabbitmq.destination.routing_key`](../attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. | | [`messaging.rabbitmq.message.delivery_tag`](../attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | Conditionally Required: When available. | -| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node operation was performed on. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node where the operation was performed. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended | **[1]:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index a6ef5d92a6..88759eb3f8 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -81,16 +81,13 @@ groups: - ref: messaging.message.envelope.size - ref: messaging.message.body.size - ref: network.peer.address - brief: Peer address of the messaging intermediary node operation was performed on. + brief: Peer address of the messaging intermediary node where the operation was performed. requirement_level: recommended: If applicable for this messaging system. note: > Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. - Network peer address and port are important when the application interacts with individual intermediary nodes directly, - for example, when messaging intermediary is self-hosted. - - Instrumentations for messaging systems that don't provide self-hosted mode SHOULD NOT set this attribute. + Network peer address and port are important when the application interacts with individual intermediary nodes directly If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - ref: network.peer.port From 7afa1b693606e80c17ac09ab586fba324311aa3d Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 18 Mar 2024 10:46:44 -0700 Subject: [PATCH 11/12] review comments --- docs/messaging/kafka.md | 1 + docs/messaging/messaging-spans.md | 2 +- model/trace/messaging.yaml | 11 +++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index 742dfc621a..522c4c2a16 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -27,6 +27,7 @@ For Apache Kafka, the following additional attributes are defined: | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| +| [`messaging.destination.partition.id`](../attributes-registry/messaging.md) | string | "String representation of the partition id the message (or batch) is sent to or received from."" | `1` | Recommended | | [`messaging.kafka.consumer.group`](../attributes-registry/messaging.md) | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` | Recommended | | [`messaging.kafka.message.key`](../attributes-registry/messaging.md) | string | Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. [1] | `myKey` | Recommended | | [`messaging.kafka.message.offset`](../attributes-registry/messaging.md) | int | The offset of a record in the corresponding Kafka partition. | `42` | Recommended | diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index e4cc45f60d..e0f486a22f 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -343,7 +343,7 @@ size should be used. **[13]:** If a custom value is used, it MUST be of low cardinality. **[14]:** Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. -Network peer address and port are important when the application interacts with individual intermediary nodes directly +Network peer address and port are important when the application interacts with individual intermediary nodes directly, If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. **[15]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 88759eb3f8..f8a4efc987 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -87,7 +87,7 @@ groups: note: > Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. - Network peer address and port are important when the application interacts with individual intermediary nodes directly + Network peer address and port are important when the application interacts with individual intermediary nodes directly, If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - ref: network.peer.port @@ -102,11 +102,9 @@ groups: - ref: network.peer.address requirement_level: recommended note: > - If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - tag: tech-specific + If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - ref: network.peer.port requirement_level: recommended - tag: tech-specific - id: messaging.rabbitmq type: attribute_group @@ -123,9 +121,6 @@ groups: conditionally_required: When available. tag: tech-specific - ref: network.peer.address - note: > - If an operation involved multiple network calls (for example retries), - the address of the last contacted node SHOULD be used. tag: tech-specific - ref: network.peer.port tag: tech-specific @@ -139,7 +134,7 @@ groups: - ref: messaging.destination.partition.id brief: > "String representation of the partition id the message (or batch) is sent to or received from."" - tag: tech-specific-kafka + tag: tech-specific - ref: messaging.kafka.message.key tag: tech-specific - ref: messaging.kafka.consumer.group From f04c4900dfa1625558febefc95ae90656371ad94 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 18 Mar 2024 11:33:44 -0700 Subject: [PATCH 12/12] update port --- docs/messaging/messaging-spans.md | 2 +- docs/messaging/rabbitmq.md | 2 +- model/trace/messaging.yaml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index e0f486a22f..f78ad5993c 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -295,7 +295,7 @@ as described in [Attributes specific to certain messaging systems](#attributes-s | [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [13] | `publish` | Required | | [`messaging.system`](../attributes-registry/messaging.md) | string | An identifier for the messaging system being used. See below for a list of well-known identifiers. | `activemq` | Required | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node where the operation was performed. [14] | `10.1.2.80`; `/tmp/my.sock` | Recommended: If applicable for this messaging system. | -| [`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. | +| [`network.peer.port`](../attributes-registry/network.md) | int | Peer port of the messaging intermediary node where the operation was performed. | `65123` | Recommended: if and only if `network.peer.address` is set. | | [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | | [`server.port`](../attributes-registry/server.md) | int | Server port number. [16] | `80`; `8080`; `443` | Recommended | diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 362fd162a8..7852546f4d 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -23,7 +23,7 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. | [`messaging.rabbitmq.destination.routing_key`](../attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. | | [`messaging.rabbitmq.message.delivery_tag`](../attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | Conditionally Required: When available. | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the messaging intermediary node where the operation was performed. [1] | `10.1.2.80`; `/tmp/my.sock` | Recommended | -| [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | Recommended | +| [`network.peer.port`](../attributes-registry/network.md) | int | Peer port of the messaging intermediary node where the operation was performed. | `65123` | Recommended | **[1]:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index f8a4efc987..75410d34de 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -91,6 +91,7 @@ groups: If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - ref: network.peer.port + brief: Peer port of the messaging intermediary node where the operation was performed. requirement_level: recommended: if and only if `network.peer.address` is set.