Messaging
General Messaging Attributes
Attributes describing telemetry around messaging systems and messaging activities.
Attributes:
| Key | Stability | Value Type | Description | Example Values |
|---|---|---|---|---|
messaging.batch.message_count | int | The number of messages sent, received, or processed in the scope of the batching operation. [1] | 0; 1; 2 | |
messaging.client.id | string | A unique identifier for the client that consumes or produces a message. | client-5; myhost@8742@s8083jm | |
messaging.consumer.group.name | string | The name of the consumer group with which a consumer is associated. [2] | my-group; indexer | |
messaging.destination.anonymous | boolean | A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). | ||
messaging.destination.name | string | The message destination name [3] | MyQueue; MyTopic | |
messaging.destination.partition.id | string | The identifier of the partition messages are sent to or received from, unique within the messaging.destination.name. | 1 | |
messaging.destination.subscription.name | string | The name of the destination subscription from which a message is consumed. [4] | subscription-a | |
messaging.destination.template | string | Low cardinality representation of the messaging destination name [5] | /customers/{customerId} | |
messaging.destination.temporary | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | ||
messaging.message.body.size | int | The size of the message body in bytes. [6] | 1439 | |
messaging.message.conversation_id | string | The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called “Correlation ID”. | MyConversationId | |
messaging.message.envelope.size | int | The size of the message body and metadata in bytes. [7] | 2738 | |
messaging.message.id | string | A value used by the messaging system as an identifier for the message, represented as a string. | 452a7c7c7c7048c2f887f61572b18fc2 | |
messaging.operation.name | string | The system-specific name of the messaging operation. | ack; nack; send | |
messaging.operation.type | string | A string identifying the type of the messaging operation. [8] | create; send; receive (see more) | |
messaging.system.name | string | The messaging system as identified by the client instrumentation. [9] | activemq; aws.sns; aws.sqs (see more) |
[1] messaging.batch.message_count: Instrumentations SHOULD NOT set messaging.batch.message_count on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use messaging.batch.message_count for batching APIs and SHOULD NOT use it for single-message APIs.
[2] messaging.consumer.group.name: Semantic conventions for individual messaging systems SHOULD document whether messaging.consumer.group.name is applicable and what it means in the context of that system.
[3] messaging.destination.name: SHOULD uniquely identify a specific queue, topic or other entity within the broker. If
the broker doesn’t have such notion, it SHOULD uniquely identify the broker.
[4] messaging.destination.subscription.name: Semantic conventions for individual messaging systems SHOULD document whether messaging.destination.subscription.name is applicable and what it means in the context of that system.
[5] messaging.destination.template: Destination names could be constructed from templates. An example would be a destination name involving a username 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.
[6] 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.
[7] messaging.message.envelope.size: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed
size should be used.
[8] messaging.operation.type: If a custom value is used, it MUST be of low cardinality.
[9] messaging.system.name: The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the messaging.system.name is set to kafka based on the instrumentation’s best knowledge.
messaging.operation.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
create | A message is created. “Create” spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | |
process | One or more messages are processed by a consumer. | |
receive | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | |
send | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the “Send” span can be used as the creation context and no “Create” span needs to be created. | |
settle | One or more messages are settled. |
messaging.system.name has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
activemq | Apache ActiveMQ | |
aws.sns | Amazon Simple Notification Service (SNS) | |
aws.sqs | Amazon Simple Queue Service (SQS) | |
azure.eventgrid | Azure Event Grid | |
azure.eventhubs | Azure Event Hubs | |
azure.servicebus | Azure Service Bus | |
gcp.pubsub | Google Cloud Pub/Sub | |
jms | Java Message Service | |
kafka | Apache Kafka | |
pulsar | Apache Pulsar | |
rabbitmq | RabbitMQ | |
rocketmq | Apache RocketMQ |
Deprecated Messaging Attributes
Describes deprecated messaging attributes.
Attributes:
| Key | Stability | Value Type | Description | Example Values |
|---|---|---|---|---|
messaging.client_id | Replaced by messaging.client.id. | string | Deprecated, use messaging.client.id instead. | client-5; myhost@8742@s8083jm |
messaging.destination_publish.anonymous | Removed. No replacement at this time. | boolean | Deprecated, no replacement at this time. | |
messaging.destination_publish.name | Removed. No replacement at this time. | string | Deprecated, no replacement at this time. | MyQueue; MyTopic |
messaging.eventhubs.consumer.group | Replaced by messaging.consumer.group.name. | string | Deprecated, use messaging.consumer.group.name instead. | $Default |
messaging.eventhubs.message.enqueued_time | Replaced by azure.eventhubs.message.enqueued_time. | int | Deprecated, use azure.eventhubs.message.enqueued_time instead. | 1701393730 |
messaging.gcp_pubsub.message.ack_deadline | Replaced by gcp.pubsub.message.ack_deadline. | int | Deprecated, use gcp.pubsub.message.ack_deadline instead. | 10 |
messaging.gcp_pubsub.message.ack_id | Replaced by gcp.pubsub.message.ack_id. | string | Deprecated, use gcp.pubsub.message.ack_id instead. | ack_id |
messaging.gcp_pubsub.message.delivery_attempt | Replaced by gcp.pubsub.message.delivery_attempt. | int | Deprecated, use gcp.pubsub.message.delivery_attempt instead. | 2 |
messaging.gcp_pubsub.message.ordering_key | Replaced by gcp.pubsub.message.ordering_key. | string | Deprecated, use gcp.pubsub.message.ordering_key instead. | ordering_key |
messaging.kafka.cluster.id | Replaced by kafka.cluster.id. | string | Deprecated, use kafka.cluster.id instead. [10] | MkU3OEVBNTcwNTJENDM2Qk |
messaging.kafka.consumer.group | Replaced by messaging.consumer.group.name. | string | Deprecated, use messaging.consumer.group.name instead. | my-group |
messaging.kafka.destination.partition | Record string representation of the partition ID in messaging.destination.partition.id attribute. | int | Deprecated, use messaging.destination.partition.id instead. | 2 |
messaging.kafka.message.key | Replaced by kafka.message.key. | string | Deprecated, use kafka.message.key instead. [11] | myKey |
messaging.kafka.message.offset | Replaced by kafka.offset. | int | Deprecated, use kafka.offset instead. | 42 |
messaging.kafka.message.tombstone | Replaced by kafka.message.tombstone. | boolean | Deprecated, use kafka.message.tombstone instead. | |
messaging.kafka.offset | Replaced by kafka.offset. | int | Deprecated, use kafka.offset instead. | 42 |
messaging.operation | Replaced by messaging.operation.type. | string | Deprecated, use messaging.operation.type instead. | publish; create; process |
messaging.rabbitmq.destination.routing_key | Replaced by rabbitmq.destination.routing_key. | string | Deprecated, use rabbitmq.destination.routing_key instead. | myKey |
messaging.rabbitmq.message.delivery_tag | Replaced by rabbitmq.message.delivery_tag. | int | Deprecated, use rabbitmq.message.delivery_tag instead. | 123 |
messaging.rocketmq.client_group | Replaced by messaging.consumer.group.name on the consumer spans. No replacement for producer spans. | string | Deprecated, use messaging.consumer.group.name instead. | myConsumerGroup |
messaging.rocketmq.consumption_model | Replaced by rocketmq.consumption_model. | string | Deprecated, use rocketmq.consumption_model instead. | clustering; broadcasting (see more) |
messaging.rocketmq.message.delay_time_level | Replaced by rocketmq.message.delay_time_level. | int | Deprecated, use rocketmq.message.delay_time_level instead. | 3 |
messaging.rocketmq.message.delivery_timestamp | Replaced by rocketmq.message.delivery_timestamp. | int | Deprecated, use rocketmq.message.delivery_timestamp instead. | 1665987217045 |
messaging.rocketmq.message.group | Replaced by rocketmq.message.group. | string | Deprecated, use rocketmq.message.group instead. | myMessageGroup |
messaging.rocketmq.message.keys | Replaced by rocketmq.message.keys. | string[] | Deprecated, use rocketmq.message.keys instead. | ["keyA", "keyB"] |
messaging.rocketmq.message.tag | Replaced by rocketmq.message.tag. | string | Deprecated, use rocketmq.message.tag instead. | tagA |
messaging.rocketmq.message.type | Replaced by rocketmq.message.type. | string | Deprecated, use rocketmq.message.type instead. | normal; fifo; delay (see more) |
messaging.rocketmq.namespace | Replaced by rocketmq.namespace. | string | Deprecated, use rocketmq.namespace instead. | myNamespace |
messaging.servicebus.destination.subscription_name | Replaced by messaging.destination.subscription.name. | string | Deprecated, use messaging.destination.subscription.name instead. | subscription-a |
messaging.servicebus.disposition_status | Replaced by azure.servicebus.disposition_status. | string | Deprecated, use azure.servicebus.disposition_status instead. | complete; abandon; dead_letter (see more) |
messaging.servicebus.message.delivery_count | Replaced by azure.servicebus.message.delivery_count. | int | Deprecated, use azure.servicebus.message.delivery_count instead. | 2 |
messaging.servicebus.message.enqueued_time | Replaced by azure.servicebus.message.enqueued_time. | int | Deprecated, use azure.servicebus.message.enqueued_time instead. | 1701393730 |
messaging.system | Replaced by messaging.system.name. | string | Deprecated, use messaging.system.name instead. [12] | activemq; aws.sns; aws_sqs (see more) |
[10] messaging.kafka.cluster.id: The cluster ID is a unique identifier reported by the Kafka broker. It identifies the cluster independently of the individual brokers the client is configured to connect to, and remains stable even if broker hostnames, IP addresses, or ports change.
[11] messaging.kafka.message.key: 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.
[12] messaging.system: The actual messaging system may differ from the one known by the client.
For example, when using Kafka client libraries to communicate with Azure Event Hubs, the messaging.system
is set to kafka based on the instrumentation’s best knowledge.
When migrating to messaging.system.name, update the following values:
aws_sqstoaws.sqseventgridtoazure.eventgrideventhubstoazure.eventhubsservicebustoazure.servicebusgcp_pubsubtogcp.pubsub
All other values are unchanged.
messaging.rocketmq.consumption_model has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
broadcasting | Broadcasting consumption model | |
clustering | Clustering consumption model |
messaging.rocketmq.message.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
delay | Delay message | |
fifo | FIFO message | |
normal | Normal message | |
transaction | Transaction message |
messaging.servicebus.disposition_status has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
abandon | Message is abandoned | |
complete | Message is completed | |
dead_letter | Message is sent to dead letter queue | |
defer | Message is deferred |
messaging.system has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
activemq | Apache ActiveMQ | |
aws.sns | Amazon Simple Notification Service (SNS) | |
aws_sqs | Amazon Simple Queue Service (SQS) | |
eventgrid | Azure Event Grid | |
eventhubs | Azure Event Hubs | |
gcp_pubsub | Google Cloud Pub/Sub | |
jms | Java Message Service | |
kafka | Apache Kafka | |
pulsar | Apache Pulsar | |
rabbitmq | RabbitMQ | |
rocketmq | Apache RocketMQ | |
servicebus | Azure Service Bus |
Feedback
Was this page helpful?
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!