groups: - id: messaging prefix: messaging brief: > This document defines the attributes used in messaging systems. attributes: - id: system type: string requirement_level: required brief: 'A string identifying the messaging system.' examples: ['kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'] - id: destination type: string requirement_level: required brief: > The message destination name. This might be equal to the span name but is required nevertheless. examples: ['MyQueue', 'MyTopic'] - id: destination_kind type: allow_custom_values: false members: - id: queue value: "queue" brief: "A message sent to a queue" - id: topic value: "topic" brief: "A message sent to a topic" requirement_level: conditionally_required: If the message destination is either a `queue` or `topic`. brief: 'The kind of message destination' - id: temp_destination type: boolean requirement_level: conditionally_required: If value is `true`. When missing, the value is assumed to be `false`. brief: 'A boolean that is true if the message destination is temporary.' - id: protocol type: string brief: 'The name of the transport protocol.' examples: ['AMQP', 'MQTT'] - id: protocol_version type: string brief: 'The version of the transport protocol.' examples: '0.9.1' - id: url type: string brief: 'Connection string.' examples: ['tibjmsnaming://localhost:7222', 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'] - id: message_id type: string brief: 'A value used by the messaging system as an identifier for the message, represented as a string.' examples: '452a7c7c7c7048c2f887f61572b18fc2' - id: conversation_id type: string brief: > The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". examples: 'MyConversationId' - id: message_payload_size_bytes type: int brief: > The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. examples: 2738 - id: message_payload_compressed_size_bytes type: int brief: 'The compressed size of the message payload in bytes.' examples: 2048 - ref: net.peer.name note: > This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. requirement_level: conditionally_required: If available. - ref: net.peer.ip tag: connection-level requirement_level: conditionally_required: If available. constraints: - include: network - id: messaging.producer prefix: messaging extends: messaging span_kind: producer brief: 'Semantic convention for producers of messages sent to a messaging systems.' - id: messaging.producer.synchronous prefix: messaging extends: messaging span_kind: client brief: > Semantic convention for clients of messaging systems that produce messages and synchronously wait for responses. - id: messaging.consumer prefix: messaging extends: messaging span_kind: consumer brief: 'Semantic convention for a consumer of messages received from a messaging system' attributes: - id: operation type: allow_custom_values: false members: - id: receive value: "receive" - id: process value: "process" brief: > A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - id: consumer_id type: string brief: > 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. examples: 'mygroup - client-6' - id: messaging.consumer.synchronous prefix: messaging extends: messaging.consumer span_kind: server brief: > Semantic convention for servers that consume messages received from messaging systems and always send back replies directed to the producers of these messages. - id: messaging.rabbitmq prefix: messaging.rabbitmq extends: messaging brief: > Attributes for RabbitMQ attributes: - id: routing_key type: string requirement_level: conditionally_required: If not empty. brief: > RabbitMQ message routing key. examples: 'myKey' - id: messaging.kafka prefix: messaging.kafka extends: messaging brief: > Attributes for Apache Kafka attributes: - id: message_key type: string brief: > 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. note: > If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. examples: 'myKey' - id: consumer_group type: string brief: > Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. examples: 'my-group' - id: client_id type: string brief: > Client Id for the Consumer or Producer that is handling the message. examples: 'client-5' - id: partition type: int brief: > Partition the message is sent to. examples: 2 - id: tombstone type: boolean requirement_level: conditionally_required: If value is `true`. When missing, the value is assumed to be `false`. brief: 'A boolean that is true if the message is a tombstone.' - id: messaging.rocketmq prefix: messaging.rocketmq extends: messaging brief: > Attributes for Apache RocketMQ attributes: - id: namespace type: string requirement_level: required brief: > Namespace of RocketMQ resources, resources in different namespaces are individual. examples: 'myNamespace' - id: client_group type: string requirement_level: required brief: > Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. examples: 'myConsumerGroup' - id: client_id type: string requirement_level: required brief: > The unique identifier for each client. examples: 'myhost@8742@s8083jm' - id: message_type type: allow_custom_values: false members: - id: normal value: 'normal' brief: "Normal message" - id: fifo value: 'fifo' brief: 'FIFO message' - id: delay value: 'delay' brief: 'Delay message' - id: transaction value: 'transaction' brief: 'Transaction message' brief: > Type of message. - id: message_tag type: string brief: > The secondary classifier of message besides topic. examples: tagA - id: message_keys type: string[] brief: > Key(s) of message, another way to mark message besides message id. examples: ['keyA', 'keyB'] - id: consumption_model type: allow_custom_values: false members: - id: clustering value: 'clustering' brief: 'Clustering consumption model' - id: broadcasting value: 'broadcasting' brief: 'Broadcasting consumption model' brief: > Model of message consumption. This only applies to consumer spans.