|
27 | 27 | - [Consumer spans](#consumer-spans)
|
28 | 28 | - [Messaging attributes](#messaging-attributes)
|
29 | 29 | - [Consumer attributes](#consumer-attributes)
|
30 |
| - - [Per-message attributes](#per-message-attributes) |
31 |
| - - [Attributes specific to certain messaging systems](#attributes-specific-to-certain-messaging-systems) |
| 30 | + - [Recording per-message attributes on batch operations](#recording-per-message-attributes-on-batch-operations) |
32 | 31 | - [Examples](#examples)
|
33 | 32 | - [Topic with multiple consumers](#topic-with-multiple-consumers)
|
34 | 33 | - [Batch receiving](#batch-receiving)
|
35 | 34 | - [Batch publishing](#batch-publishing)
|
36 |
| -- [Semantic Conventions for specific messaging technologies](#semantic-conventions-for-specific-messaging-technologies) |
37 | 35 |
|
38 | 36 | <!-- tocstop -->
|
39 | 37 |
|
@@ -179,7 +177,7 @@ Messaging spans SHOULD follow the overall [guidelines for span names](https://gi
|
179 | 177 | The **span name** SHOULD be `{messaging.operation.name} {destination}` (see below for the exact definition of the [`{destination}`](#destination-placeholder) placeholder).
|
180 | 178 | <!-- markdown-link-check-enable -->
|
181 | 179 |
|
182 |
| -Semantic conventions for individual messaging systems MAY specify different span name format and then MUST document it in [semantic conventions for specific messaging technologies](#semantic-conventions-for-specific-messaging-technologies). |
| 180 | +Semantic conventions for individual messaging systems MAY specify different span name format and then MUST document it in semantic conventions for specific messaging technologies. |
183 | 181 |
|
184 | 182 | The <span id="destination-placeholder">`{destination}`</span> SHOULD describe the entity that the operation is performed against
|
185 | 183 | and SHOULD adhere to one of the following values, provided they are accessible:
|
@@ -282,14 +280,13 @@ context of the message.
|
282 | 280 |
|
283 | 281 | Messaging attributes are organized into the following namespaces:
|
284 | 282 |
|
285 |
| -- `messaging.message`: Contains [per-message attributes](#per-message-attributes) that describe individual messages. Those attributes are relevant only for spans or links that represent a single message. |
| 283 | +- `messaging.message`: Contains attributes that describe individual messages. |
286 | 284 | - `messaging.destination`: Contains attributes that describe the logical entity messages are published to. See [Destinations](#destinations) for more details.
|
287 | 285 | - `messaging.destination_publish`: Contains attributes that describe the logical entity messages were originally published to. See [Destinations](#destinations) for more details.
|
288 | 286 | - `messaging.batch`: Contains attributes that describe batch operations.
|
289 | 287 | - `messaging.consumer`: Contains [consumer attributes](#consumer-attributes) that describe the application instance that consumes a message. See [consumer](#consumer) for more details.
|
290 | 288 |
|
291 |
| -Messaging system-specific attributes MUST be defined in the corresponding `messaging.{system}` namespace |
292 |
| -as described in [Attributes specific to certain messaging systems](#attributes-specific-to-certain-messaging-systems). |
| 289 | +Messaging system-specific attributes MUST be defined in the corresponding `messaging.{system}` namespace. |
293 | 290 |
|
294 | 291 | <!-- semconv messaging(full) -->
|
295 | 292 | <!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
@@ -458,24 +455,18 @@ the broker doesn't have such notion, the original destination name SHOULD unique
|
458 | 455 | <!-- END AUTOGENERATED TEXT -->
|
459 | 456 | <!-- endsemconv -->
|
460 | 457 |
|
461 |
| -### Per-message attributes |
| 458 | +### Recording per-message attributes on batch operations |
462 | 459 |
|
463 | 460 | All messaging operations (`publish`, `receive`, `process`, or others not covered by this specification) can describe both single and/or batch of messages.
|
464 |
| -Attributes in the `messaging.message` or `messaging.{system}.message` namespace describe individual messages. For single-message operations they SHOULD be set on corresponding span. |
| 461 | +Attributes in the `messaging.message` or `messaging.{system}.message` namespace apply to individual messages and typically vary between messages within the same batch. |
465 | 462 |
|
466 |
| -For batch operations, per-message attributes are usually different and cannot be set on the corresponding span. In such cases the attributes SHOULD be set on links. See [Batch receiving](#batch-receiving) for more information on correlation using links. |
| 463 | +Some messaging systems such as Kafka or Azure Event Grid allow publishing a batch of messages to different topics in a single operation, resulting in |
| 464 | +different `messaging.destination.name` or other destination attributes within a single messaging operation. |
467 | 465 |
|
468 |
| -Some messaging systems (e.g., Kafka, Azure EventGrid) allow publishing a single batch of messages to different topics. In such cases, the attributes in `messaging.destination` MAY be |
469 |
| -set on links. Instrumentations MAY set destination attributes on the span if all messages in the batch share the same destination. |
| 466 | +If the attribute value is the same for all messages in the batch, the instrumentation SHOULD set such attribute on the span representing the batch operation. |
| 467 | +If the attribute values vary, the instrumentation SHOULD set such attributes on links describing individual messages. |
470 | 468 |
|
471 |
| -### Attributes specific to certain messaging systems |
472 |
| - |
473 |
| -All attributes that are specific for a messaging system SHOULD be populated in `messaging.{system}` namespace. Attributes that describe a message, a destination, a consumer, or a batch of messages SHOULD be populated under the corresponding namespace: |
474 |
| - |
475 |
| -* `messaging.{system}.message.*`: Describes attributes for individual messages |
476 |
| -* `messaging.{system}.destination.*`: Describes the destination a message (or a batch) are published to and received from respectively. The combination of attributes in these namespaces should uniquely identify the entity and include properties significant for this messaging system. For example, Kafka instrumentations should include partition identifier. |
477 |
| -* `messaging.{system}.consumer.*`: Describes message consumer properties |
478 |
| -* `messaging.{system}.batch.*`: Describes message batch properties |
| 469 | +See [Batch receiving](#batch-receiving) for more information on correlation using links. |
479 | 470 |
|
480 | 471 | ## Examples
|
481 | 472 |
|
@@ -613,12 +604,4 @@ flowchart LR;
|
613 | 604 | | `messaging.message.id` | `"a1"` | `"a2"` | | `"a1"` | `"a2"` |
|
614 | 605 | | `messaging.batch.message_count` | | | 2 | | |
|
615 | 606 |
|
616 |
| -## Semantic Conventions for specific messaging technologies |
617 |
| - |
618 |
| -More specific Semantic Conventions are defined for the following messaging technologies: |
619 |
| - |
620 |
| -* [Kafka](kafka.md): Semantic Conventions for *Apache Kafka*. |
621 |
| -* [RabbitMQ](rabbitmq.md): Semantic Conventions for *RabbitMQ*. |
622 |
| -* [RocketMQ](rocketmq.md): Semantic Conventions for *Apache RocketMQ*. |
623 |
| - |
624 | 607 | [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
|
0 commit comments