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 1/4] 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 2/4] 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 3/4] 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 4/4] 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.