Skip to content

Commit 89a9601

Browse files
author
Liudmila Molkova
authored
BREAKING: remove messaging.destination.kind and messaging.source.kind values (#3214)
Fixes #3170, #3265, #3249 ## Changes ~~We currently allow `topic` or `queue` on `messaging.destination.kind`. While it's common in messaging world to have one or another, messaging semantic conventions can be applied to AMPQ communication (which does not have topic/queue terminology), [socket.io](https://socket.io/), and potentially other less traditional messaging use-cases.~~ It's unclear how `messaging.destination.kind` and `messaging.source.kind` could be used. The distinction between queue and topic is significant for messaging and distributed systems, but not for tracing. In either case, tracing backends should expect to process traces from 0+ messaging and 0+ messaging consumers. In either case, message consumers can be simultaneous or consequent and there could be many of them. The only known case (Solace) where it could be useful is when messaging system allows having queues and topic with the same name on the same broker, and it could be used to distinguish one from another. Based on messaging SIG discussion, the attributes are removed for the time being until we understand if and how they are useful. Depending on messaging system queues or topics behavior vary a lot and in future it would makes more sense to represent actual behavior with individual attributes such as: - auto-settlement (at-most-once or at least once guarantees) - settlement for individual messages or offsets - broadcast or unicast - etc
1 parent e7a555a commit 89a9601

File tree

3 files changed

+20
-74
lines changed

3 files changed

+20
-74
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ release.
3232
([#3272](https://github.com/open-telemetry/opentelemetry-specification/pull/3272))
3333
- Metric requirement levels are now stable
3434
([#3271](https://github.com/open-telemetry/opentelemetry-specification/pull/3271))
35+
- BREAKING: remove `messaging.destination.kind` and `messaging.source.kind`.
36+
([#3214](https://github.com/open-telemetry/opentelemetry-specification/pull/3214))
3537

3638
### Compatibility
3739

semantic_conventions/trace/messaging.yaml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ groups:
3939
Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If
4040
the broker does not have such notion, the destination name SHOULD uniquely identify the broker.
4141
examples: ['MyQueue', 'MyTopic']
42-
- id: kind
43-
type:
44-
allow_custom_values: false
45-
members:
46-
- id: queue
47-
value: "queue"
48-
brief: "A message sent to a queue"
49-
- id: topic
50-
value: "topic"
51-
brief: "A message sent to a topic"
52-
brief: 'The kind of message destination'
5342
- id: template
5443
type: string
5544
brief: Low cardinality representation of the messaging destination name
@@ -79,17 +68,6 @@ groups:
7968
Source name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If
8069
the broker does not have such notion, the source name SHOULD uniquely identify the broker.
8170
examples: ['MyQueue', 'MyTopic']
82-
- id: kind
83-
type:
84-
allow_custom_values: true
85-
members:
86-
- id: queue
87-
value: "queue"
88-
brief: "A message received from a queue"
89-
- id: topic
90-
value: "topic"
91-
brief: "A message received from a topic"
92-
brief: 'The kind of message source'
9371
- id: template
9472
type: string
9573
brief: 'Low cardinality representation of the messaging source name'
@@ -187,9 +165,6 @@ groups:
187165
- ref: messaging.destination.name
188166
requirement_level:
189167
conditionally_required: If one message is being published or if the value applies to all messages in the batch.
190-
- ref: messaging.destination.kind
191-
requirement_level:
192-
conditionally_required: If the message destination is either a `queue` or a `topic`.
193168
- ref: messaging.destination.template
194169
requirement_level:
195170
conditionally_required: >
@@ -229,9 +204,6 @@ groups:
229204
- ref: messaging.source.name
230205
requirement_level:
231206
conditionally_required: If the value applies to all messages in the batch.
232-
- ref: messaging.source.kind
233-
requirement_level:
234-
conditionally_required: If the message source is either a `queue` or `topic`.
235207
- ref: messaging.source.template
236208
requirement_level:
237209
conditionally_required: >
@@ -246,9 +218,6 @@ groups:
246218
- ref: messaging.destination.name
247219
requirement_level:
248220
recommended: If known on consumer
249-
- ref: messaging.destination.kind
250-
requirement_level:
251-
recommended: If known on consumer
252221
- ref: messaging.destination.temporary
253222
requirement_level:
254223
recommended: If known on consumer

specification/trace/semantic_conventions/messaging.md

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,11 @@ might be another intermediary or a consumer.
7878
### Destinations and sources
7979

8080
A destination is usually uniquely identified by name within the messaging system instance. Examples of a destination name would be a URL or a simple one-word identifier.
81-
Traditional messaging, such as JMS, involves two kinds of destinations: *topic*s and *queue*s.
82-
83-
A message that is sent (the send-operation is often called "*publish*" in this context) to a *topic* is broadcasted to all consumers that have *subscribed* to the topic.
84-
85-
A message that is sent to a *queue* is processed by a message *consumer* (usually exactly once although some message systems support a more performant at-least-once mode for messages with [idempotent][] processing).
81+
Sending messages to a destination is called "*publish*" in context of this specification.
8682

8783
A source represents an entity within messaging system messages are consumed from. Source and destination for specific message may be the same. However, if message is routed within one or multiple brokers, source and destination can be different.
8884

89-
In a messaging system such as Apache Kafka, all destinations are *topic*s.
90-
Each record, or message, is sent to a single consumer per consumer group.
91-
Consumer groups provide *deliver once* semantics for consumers of a topic within a group.
92-
Whether a specific message is processed as if it was sent to a topic or queue entirely depends on the consumer groups and their composition.
93-
For instance, there can be multiple consumer groups processing records from the same topic.
94-
95-
[idempotent]: https://en.wikipedia.org/wiki/Idempotence
85+
Typical examples of destinations and sources include Kafka topics, RabbitMQ queues and topics.
9686

9787
### Message consumption
9888

@@ -274,25 +264,22 @@ The following additional attributes describe message producer operations.
274264
| Attribute | Type | Description | Examples | Requirement Level |
275265
|---|---|---|---|---|
276266
| `messaging.destination.anonymous` | boolean | A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). | | Conditionally Required: [1] |
277-
| `messaging.destination.kind` | string | The kind of message destination | `queue` | Conditionally Required: [2] |
278-
| `messaging.destination.name` | string | The message destination name [3] | `MyQueue`; `MyTopic` | Conditionally Required: [4] |
279-
| `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [5] | `/customers/{customerId}` | Conditionally Required: [6] |
280-
| `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | Conditionally Required: [7] |
267+
| `messaging.destination.name` | string | The message destination name [2] | `MyQueue`; `MyTopic` | Conditionally Required: [3] |
268+
| `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [4] | `/customers/{customerId}` | Conditionally Required: [5] |
269+
| `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | Conditionally Required: [6] |
281270

282271
**[1]:** If value is `true`. When missing, the value is assumed to be `false`.
283272

284-
**[2]:** If the message destination is either a `queue` or a `topic`.
285-
286-
**[3]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If
273+
**[2]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If
287274
the broker does not have such notion, the destination name SHOULD uniquely identify the broker.
288275

289-
**[4]:** If one message is being published or if the value applies to all messages in the batch.
276+
**[3]:** If one message is being published or if the value applies to all messages in the batch.
290277

291-
**[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.
278+
**[4]:** 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.
292279

293-
**[6]:** If available. Instrumentations MUST NOT use `messaging.destination.name` as template unless low-cardinality of destination name is guaranteed.
280+
**[5]:** If available. Instrumentations MUST NOT use `messaging.destination.name` as template unless low-cardinality of destination name is guaranteed.
294281

295-
**[7]:** If value is `true`. When missing, the value is assumed to be `false`.
282+
**[6]:** If value is `true`. When missing, the value is assumed to be `false`.
296283
<!-- endsemconv -->
297284

298285
### Consumer attributes
@@ -306,32 +293,28 @@ The following additional attributes describe message consumer operations.
306293
|---|---|---|---|---|
307294
| `messaging.consumer.id` | string | The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer.group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. | `mygroup - client-6` | Recommended |
308295
| `messaging.destination.anonymous` | boolean | A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). | | Recommended: If known on consumer |
309-
| `messaging.destination.kind` | string | The kind of message destination | `queue` | Recommended: If known on consumer |
310296
| `messaging.destination.name` | string | The message destination name [1] | `MyQueue`; `MyTopic` | Recommended: If known on consumer |
311297
| `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | Recommended: If known on consumer |
312298
| `messaging.source.anonymous` | boolean | A boolean that is true if the message source is anonymous (could be unnamed or have auto-generated name). | | Recommended: [2] |
313-
| `messaging.source.kind` | string | The kind of message source | `queue` | Conditionally Required: [3] |
314-
| `messaging.source.name` | string | The message source name [4] | `MyQueue`; `MyTopic` | Conditionally Required: [5] |
315-
| `messaging.source.template` | string | Low cardinality representation of the messaging source name [6] | `/customers/{customerId}` | Conditionally Required: [7] |
316-
| `messaging.source.temporary` | boolean | A boolean that is true if the message source is temporary and might not exist anymore after messages are processed. | | Recommended: [8] |
299+
| `messaging.source.name` | string | The message source name [3] | `MyQueue`; `MyTopic` | Conditionally Required: [4] |
300+
| `messaging.source.template` | string | Low cardinality representation of the messaging source name [5] | `/customers/{customerId}` | Conditionally Required: [6] |
301+
| `messaging.source.temporary` | boolean | A boolean that is true if the message source is temporary and might not exist anymore after messages are processed. | | Recommended: [7] |
317302

318303
**[1]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If
319304
the broker does not have such notion, the destination name SHOULD uniquely identify the broker.
320305

321306
**[2]:** When supported by messaging system and only if the source is anonymous. When missing, the value is assumed to be `false`.
322307

323-
**[3]:** If the message source is either a `queue` or `topic`.
324-
325-
**[4]:** Source name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If
308+
**[3]:** Source name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If
326309
the broker does not have such notion, the source name SHOULD uniquely identify the broker.
327310

328-
**[5]:** If the value applies to all messages in the batch.
311+
**[4]:** If the value applies to all messages in the batch.
329312

330-
**[6]:** Source names could be constructed from templates. An example would be a source name involving a user name or product id. Although the source name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation.
313+
**[5]:** Source names could be constructed from templates. An example would be a source name involving a user name or product id. Although the source name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation.
331314

332-
**[7]:** If available. Instrumentations MUST NOT use `messaging.source.name` as template unless low-cardinality of source name is guaranteed.
315+
**[6]:** If available. Instrumentations MUST NOT use `messaging.source.name` as template unless low-cardinality of source name is guaranteed.
333316

334-
**[8]:** When supported by messaging system and only if the source is temporary. When missing, the value is assumed to be `false`.
317+
**[7]:** When supported by messaging system and only if the source is temporary. When missing, the value is assumed to be `false`.
335318
<!-- endsemconv -->
336319

337320
The *receive* span is be used to track the time used for receiving the message(s), whereas the *process* span(s) track the time for processing the message(s).
@@ -459,9 +442,7 @@ Process CB: | Span CB1 |
459442
| `net.peer.port` | `1234` | `1234` | `1234` |
460443
| `messaging.system` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` |
461444
| `messaging.destination.name` | `"T"` | | |
462-
| `messaging.destination.kind` | `"topic"` | | |
463445
| `messaging.source.name` | | `"T"` | `"T"` |
464-
| `messaging.source.kind` | | `"topic"` | `"topic"` |
465446
| `messaging.operation` | | `"process"` | `"process"` |
466447
| `messaging.message.id` | `"a1"` | `"a1"`| `"a1"` |
467448

@@ -496,9 +477,7 @@ Process CB: | Span Rcv2 |
496477
| `service.name` | | `"myConsumer1"` | `"myConsumer1"` | | `"myConsumer2"` |
497478
| `messaging.system` | `"kafka"` | `"kafka"` | `"kafka"` | `"kafka"` | `"kafka"` |
498479
| `messaging.destination.name` | `"T1"` | | | | |
499-
| `messaging.destination.kind` | `"topic"` | | | | |
500480
| `messaging.source.name` | | `"T1"` | `"T1"` | `"T2"` | `"T2"` |
501-
| `messaging.source.kind` | | `"topic"` | `"topic"` | `"topic"` | `"topic"` |
502481
| `messaging.operation` | | | `"process"` | | `"receive"` |
503482
| `messaging.kafka.message.key` | `"myKey"` | `"myKey"` | `"myKey"` | `"anotherKey"` | `"anotherKey"` |
504483
| `messaging.kafka.consumer.group` | | `"my-group"` | `"my-group"` | | `"another-group"` |
@@ -531,9 +510,7 @@ Process C: | Span Recv1 |
531510
| `net.peer.port` | `1234` | `1234` | `1234` | `1234` | `1234` |
532511
| `messaging.system` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` |
533512
| `messaging.destination.name` | `"Q"` | `"Q"` | | | |
534-
| `messaging.destination.kind` | `"queue"` | `"queue"` | | | |
535513
| `messaging.source.name` | | | `"Q"` | `"Q"` | `"Q"` |
536-
| `messaging.source.kind` | | | `"queue"` | `"queue"` | `"queue"` |
537514
| `messaging.operation` | | | `"receive"` | `"process"` | `"process"` |
538515
| `messaging.message.id` | `"a1"` | `"a2"` | | `"a1"` | `"a2"` |
539516
| `messaging.batch.message_count` | | | 2 | | |
@@ -568,9 +545,7 @@ Process C: | Span Recv1 | Span Recv2 |
568545
| `net.peer.port` | `1234` | `1234` | `1234` | `1234` | `1234` |
569546
| `messaging.system` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` |
570547
| `messaging.destination.name` | `"Q"` | `"Q"` | | | |
571-
| `messaging.destination.kind` | `"queue"` | `"queue"` | | | |
572548
| `messaging.source.name` | | | `"Q"` | `"Q"` | `"Q"` |
573-
| `messaging.source.kind` | | | `"queue"` | `"queue"` | `"queue"` |
574549
| `messaging.operation` | | | `"receive"` | `"receive"` | `"process"` |
575550
| `messaging.message.id` | `"a1"` | `"a2"` | `"a1"` | `"a2"` | |
576551
| `messaging.batch.message_count` | | | 1 | 1 | 2 |

0 commit comments

Comments
 (0)