From d9574a8da3adfd795bc028e0f579e72ede4c4beb Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:37:59 +0100 Subject: [PATCH 01/11] Specify destination name for RabbitMQ --- docs/messaging/rabbitmq.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index a0f9c1a62e..1a1adb84ee 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -12,8 +12,15 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov ## RabbitMQ attributes +### Destination name + 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. +`messaging.destination.name` MUST be set according to the following rules: + +- Both *exchange* and *routing key* present and non-empty: `{exchange}:{routing key}` +- Only *exchange* present and non-empty: `{exchange}` +- Only *routing key* present and non-empty: `{routing key}` +- Otherwise: `amp.default` From 6efe0b31d3f1216489a92397f7a67816eb9c64cc Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:46:35 +0100 Subject: [PATCH 02/11] Add changelog --- .chloggen/rabbitmq-destination-name.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 .chloggen/rabbitmq-destination-name.yaml diff --git a/.chloggen/rabbitmq-destination-name.yaml b/.chloggen/rabbitmq-destination-name.yaml new file mode 100755 index 0000000000..2d795f1b44 --- /dev/null +++ b/.chloggen/rabbitmq-destination-name.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: messaging +note: "RabbitMQ: Specify how to populate `messaging.destination.name`" +issues: [1529] From b02ff2ae3bb8d7054e82ab7504167a2d35801204 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:55:03 +0100 Subject: [PATCH 03/11] Add queue to destination name --- docs/messaging/rabbitmq.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 1a1adb84ee..4febc234d2 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -14,13 +14,19 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov ### Destination name -In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. -`messaging.destination.name` MUST be set according to the following rules: +In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and +for consumers, a *queue*. +`messaging.destination.name` MUST be set to: -- Both *exchange* and *routing key* present and non-empty: `{exchange}:{routing key}` -- Only *exchange* present and non-empty: `{exchange}` -- Only *routing key* present and non-empty: `{routing key}` -- Otherwise: `amp.default` +**Producers** + +- `{exchange}:{routing key}` when both values are present and non-empty. +If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. +- Otherwise: `amq.default` + +**Consumers** +- `{exchange}:{routing key}:{queue}` when all values are present and non-empty. +If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. From 29209ae03750b5117b8c8bb4ec942af48fb53e96 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:56:53 +0100 Subject: [PATCH 04/11] Lint --- docs/messaging/rabbitmq.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 4febc234d2..678ec1ebbb 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -18,13 +18,14 @@ In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and for consumers, a *queue*. `messaging.destination.name` MUST be set to: -**Producers** +#### Producers - `{exchange}:{routing key}` when both values are present and non-empty. If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. - Otherwise: `amq.default` -**Consumers** +#### Consumers + - `{exchange}:{routing key}:{queue}` when all values are present and non-empty. If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. From 69b8141734b73e2affc22cd82f8d95c6011ba02c Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:08:30 +0100 Subject: [PATCH 05/11] simply and remove queue from dest name --- docs/messaging/rabbitmq.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index f21cac8456..3e8e25643e 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -42,20 +42,13 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov ### Destination name -In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and -for consumers, a *queue*. -`messaging.destination.name` MUST be set to: +In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. -#### Producers +`messaging.destination.name` MUST be set to: `{exchange}.{routing_key}` +when both `exchange` and `routing_key` are non-empty. -- `{exchange}:{routing key}` when both values are present and non-empty. -If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. -- Otherwise: `amq.default` - -#### Consumers - -- `{exchange}:{routing key}:{queue}` when all values are present and non-empty. -If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. +When the default exchange is used, `messaging.destination.name` MUST be set to +`amq.default`. From ca4034f39efde4b18e1c4b1dba97c7270dc846cb Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:07:15 +0100 Subject: [PATCH 06/11] rollback --- docs/messaging/rabbitmq.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 3e8e25643e..1865291288 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -42,13 +42,24 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov ### Destination name -In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. +n RabbitMQ, the destination is defined by an *exchange*, a *routing key* and +for consumers, a *queue*. -`messaging.destination.name` MUST be set to: `{exchange}.{routing_key}` -when both `exchange` and `routing_key` are non-empty. +`messaging.destination.name` MUST be set to: -When the default exchange is used, `messaging.destination.name` MUST be set to -`amq.default`. +#### Producers + +- `{exchange}:{routing key}` when both values are present and non-empty. +If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. +- Otherwise: `amq.default` + +#### Consumers + +- `{exchange}:{routing key}:{queue}` when all values are present and non-empty. +If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. + +For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD +be used, e.g., `{exchange}:{routing key}`. From 210cea082248d699753abec90cf4b23cad729dc3 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:09:09 +0100 Subject: [PATCH 07/11] PR suggestions --- docs/messaging/rabbitmq.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 1865291288..c154a91b87 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -42,16 +42,16 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov ### Destination name -n RabbitMQ, the destination is defined by an *exchange*, a *routing key* and +In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and for consumers, a *queue*. -`messaging.destination.name` MUST be set to: +`messaging.destination.name` SHOULD be set to: #### Producers - `{exchange}:{routing key}` when both values are present and non-empty. If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. -- Otherwise: `amq.default` +- Otherwise: `amq.default` when the default exchange is used and no routing key is provided #### Consumers From f48427fa52ee06c5fa8f5b957c128fe4abc20e4b Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:16:27 +0100 Subject: [PATCH 08/11] Add guidance on yaml file --- docs/messaging/rabbitmq.md | 36 ++++++++++++------------------------ model/messaging/spans.yaml | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index c154a91b87..62edf03841 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -40,27 +40,6 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov ## RabbitMQ attributes -### Destination name - -In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and -for consumers, a *queue*. - -`messaging.destination.name` SHOULD be set to: - -#### Producers - -- `{exchange}:{routing key}` when both values are present and non-empty. -If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. -- Otherwise: `amq.default` when the default exchange is used and no routing key is provided - -#### Consumers - -- `{exchange}:{routing key}:{queue}` when all values are present and non-empty. -If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. - -For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD -be used, e.g., `{exchange}:{routing key}`. - @@ -72,7 +51,7 @@ be used, e.g., `{exchange}:{routing key}`. |---|---|---|---|---|---| | [`messaging.operation.name`](/docs/attributes-registry/messaging.md) | string | The system-specific name of the messaging operation. | `ack`; `nack`; `send` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `amqp:decode-error`; `KAFKA_STORAGE_ERROR`; `channel-error` | `Conditionally Required` If and only if the messaging operation has failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [2] | `MyQueue`; `MyTopic` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [2] | `direct_logs:warning`; `logs` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [4] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rabbitmq.destination.routing_key`](/docs/attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | `Conditionally Required` If not empty. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rabbitmq.message.delivery_tag`](/docs/attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | `Conditionally Required` When available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -104,8 +83,17 @@ it's RECOMMENDED to: - Use a domain-specific attribute - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. -**[2] `messaging.destination.name`:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If -the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. +**[2] `messaging.destination.name`:** In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and for consumers, a *queue*. + +`messaging.destination.name` SHOULD be set to: + +- **Producers**: `{exchange}:{routing key}` when both values are present and non-empty. +Otherwise: `amq.default` when the default exchange is used and no routing key is provided + +- **Consumers**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. +If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. +For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD +be used, e.g., `{exchange}:{routing key}`. **[3] `messaging.destination.name`:** If span describes operation on a single message or if the value applies to all messages in the batch. diff --git a/model/messaging/spans.yaml b/model/messaging/spans.yaml index a5b76e0b0b..3ebf0882fb 100644 --- a/model/messaging/spans.yaml +++ b/model/messaging/spans.yaml @@ -118,6 +118,22 @@ groups: Message [correlation Id](https://www.rabbitmq.com/tutorials/tutorial-six-java#correlation-id) property. - ref: messaging.message.body.size requirement_level: opt_in + - ref: messaging.destination.name + note: | + In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and for consumers, a *queue*. + + `messaging.destination.name` SHOULD be set to: + + - **Producers**: `{exchange}:{routing key}` when both values are present and non-empty. + Otherwise: `amq.default` when the default exchange is used and no routing key is provided + + - **Consumers**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. + If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. + For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD + be used, e.g., `{exchange}:{routing key}`. + examples: ['direct_logs:warning', 'logs'] + requirement_level: + conditionally_required: If span describes operation on a single message or if the value applies to all messages in the batch. - id: messaging.kafka type: attribute_group From bde99d03a24315db9777f533fe7d0832accb53d5 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:15:55 +0100 Subject: [PATCH 09/11] make destination name required for rabbitmq and remove batching case --- docs/messaging/rabbitmq.md | 52 ++++++++++++++++++-------------------- model/messaging/spans.yaml | 3 +-- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 62edf03841..7fa3b83029 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -49,21 +49,33 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [1] | `direct_logs:warning`; `logs` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.operation.name`](/docs/attributes-registry/messaging.md) | string | The system-specific name of the messaging operation. | `ack`; `nack`; `send` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `amqp:decode-error`; `KAFKA_STORAGE_ERROR`; `channel-error` | `Conditionally Required` If and only if the messaging operation has failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [2] | `direct_logs:warning`; `logs` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [4] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [2] | `amqp:decode-error`; `KAFKA_STORAGE_ERROR`; `channel-error` | `Conditionally Required` If and only if the messaging operation has failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [3] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rabbitmq.destination.routing_key`](/docs/attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | `Conditionally Required` If not empty. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rabbitmq.message.delivery_tag`](/docs/attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | `Conditionally Required` When available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [4] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.message.conversation_id`](/docs/attributes-registry/messaging.md) | string | Message [correlation Id](https://www.rabbitmq.com/tutorials/tutorial-six-java#correlation-id) property. | `MyConversationId` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.id`](/docs/attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [6] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [5] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [8] | `1439` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [7] | `1439` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `error.type`:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality. +**[1] `messaging.destination.name`:** In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and for consumers, a *queue*. + +`messaging.destination.name` SHOULD be set to: + +- **Producers**: `{exchange}:{routing key}` when both values are present and non-empty. +Otherwise: `amq.default` when the default exchange is used and no routing key is provided + +- **Consumers**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. +If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. +For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD +be used, e.g., `{exchange}:{routing key}`. + +**[2] `error.type`:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality. When `error.type` is set to a type (e.g., an exception type), its canonical class name identifying the type within the artifact SHOULD be used. @@ -83,29 +95,15 @@ it's RECOMMENDED to: - Use a domain-specific attribute - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. -**[2] `messaging.destination.name`:** In RabbitMQ, the destination is defined by an *exchange*, a *routing key* and for consumers, a *queue*. - -`messaging.destination.name` SHOULD be set to: - -- **Producers**: `{exchange}:{routing key}` when both values are present and non-empty. -Otherwise: `amq.default` when the default exchange is used and no routing key is provided - -- **Consumers**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. -If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. -For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD -be used, e.g., `{exchange}:{routing key}`. - -**[3] `messaging.destination.name`:** If span describes operation on a single message or if the value applies to all messages in the batch. - -**[4] `messaging.operation.type`:** If a custom value is used, it MUST be of low cardinality. +**[3] `messaging.operation.type`:** If a custom value is used, it MUST be of low cardinality. -**[5] `server.address`:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +**[4] `server.address`:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[6] `network.peer.address`:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[5] `network.peer.address`:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[7] `server.port`:** 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. +**[6] `server.port`:** 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. -**[8] `messaging.message.body.size`:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +**[7] `messaging.message.body.size`:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. The following attributes can be important for making sampling decisions diff --git a/model/messaging/spans.yaml b/model/messaging/spans.yaml index 3ebf0882fb..052b0f1bf2 100644 --- a/model/messaging/spans.yaml +++ b/model/messaging/spans.yaml @@ -132,8 +132,7 @@ groups: For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD be used, e.g., `{exchange}:{routing key}`. examples: ['direct_logs:warning', 'logs'] - requirement_level: - conditionally_required: If span describes operation on a single message or if the value applies to all messages in the batch. + requirement_level: required - id: messaging.kafka type: attribute_group From 568f90c2b15289108d784169fb827b40d7a95cf6 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Fri, 27 Dec 2024 15:08:34 +0100 Subject: [PATCH 10/11] Pr suggestions --- docs/messaging/rabbitmq.md | 5 +++-- model/messaging/spans.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 7fa3b83029..779b3856b7 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -67,10 +67,11 @@ The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) extend and ov `messaging.destination.name` SHOULD be set to: -- **Producers**: `{exchange}:{routing key}` when both values are present and non-empty. +- **On the producer side**: `{exchange}:{routing key}` when both values are present and non-empty. +When only one is available, only that value SHOULD be used. E.g., `{exchange}` or `{routing key}`. Otherwise: `amq.default` when the default exchange is used and no routing key is provided -- **Consumers**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. +- **On the consumer side**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD be used, e.g., `{exchange}:{routing key}`. diff --git a/model/messaging/spans.yaml b/model/messaging/spans.yaml index 052b0f1bf2..2d54b88d21 100644 --- a/model/messaging/spans.yaml +++ b/model/messaging/spans.yaml @@ -124,10 +124,11 @@ groups: `messaging.destination.name` SHOULD be set to: - - **Producers**: `{exchange}:{routing key}` when both values are present and non-empty. + - **On the producer side**: `{exchange}:{routing key}` when both values are present and non-empty. + When only one is avaiable, only that value SHOULD be used. E.g., `{exchange}` or `{routing key}`. Otherwise: `amq.default` when the default exchange is used and no routing key is provided - - **Consumers**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. + - **On the consumer side**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty. If any has an empty value (e.g., the default exchange is used) it SHOULD be omitted. For cases when `{routing key}` and `{queue}` are equal, only one of them SHOULD be used, e.g., `{exchange}:{routing key}`. From 359cf025c6c89f071f0e375393947549b6937a34 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Fri, 27 Dec 2024 15:24:23 +0100 Subject: [PATCH 11/11] fix typo --- model/messaging/spans.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/messaging/spans.yaml b/model/messaging/spans.yaml index 2d54b88d21..2055823d09 100644 --- a/model/messaging/spans.yaml +++ b/model/messaging/spans.yaml @@ -125,7 +125,7 @@ groups: `messaging.destination.name` SHOULD be set to: - **On the producer side**: `{exchange}:{routing key}` when both values are present and non-empty. - When only one is avaiable, only that value SHOULD be used. E.g., `{exchange}` or `{routing key}`. + When only one is available, only that value SHOULD be used. E.g., `{exchange}` or `{routing key}`. Otherwise: `amq.default` when the default exchange is used and no routing key is provided - **On the consumer side**: `{exchange}:{routing key}:{queue}` when all values are present and non-empty.