diff --git a/CHANGELOG.md b/CHANGELOG.md index 65af17c60e9..8a69d25844e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,9 +28,10 @@ release. ([#1973](https://github.com/open-telemetry/opentelemetry-specification/pull/1973)) - Add Tencent Cloud as a cloud provider. ([#2006](https://github.com/open-telemetry/opentelemetry-specification/pull/2006)) - - Don't set Span.Status for 4xx http status codes for SERVER spans. ([#1998](https://github.com/open-telemetry/opentelemetry-specification/pull/1998)) +- Add attributes for Apache RocketMQ. + ([#1904](https://github.com/open-telemetry/opentelemetry-specification/pull/1904)) ### Compatibility diff --git a/semantic_conventions/trace/messaging.yaml b/semantic_conventions/trace/messaging.yaml index 03c8baeb176..d83d6e94a6a 100644 --- a/semantic_conventions/trace/messaging.yaml +++ b/semantic_conventions/trace/messaging.yaml @@ -9,7 +9,7 @@ groups: type: string required: always brief: 'A string identifying the messaging system.' - examples: ['kafka', 'rabbitmq', 'activemq', 'AmazonSQS'] + examples: ['kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'] - id: destination type: string required: always @@ -180,3 +180,68 @@ groups: required: conditional: 'If missing, it 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 + required: always + brief: > + Namespace of RocketMQ resources, resources in different namespaces are individual. + examples: 'myNamespace' + - id: client_group + type: string + required: always + 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 + required: always + 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. diff --git a/specification/trace/semantic_conventions/messaging.md b/specification/trace/semantic_conventions/messaging.md index 41c2341bb4f..40861138abc 100644 --- a/specification/trace/semantic_conventions/messaging.md +++ b/specification/trace/semantic_conventions/messaging.md @@ -19,6 +19,7 @@ * [Attributes specific to certain messaging systems](#attributes-specific-to-certain-messaging-systems) + [RabbitMQ](#rabbitmq) + [Apache Kafka](#apache-kafka) + + [Apache RocketMQ](#apache-rocketmq) - [Examples](#examples) * [Topic with multiple consumers](#topic-with-multiple-consumers) * [Apache Kafka with Quarkus or Spring Boot Example](#apache-kafka-with-quarkus-or-spring-boot-example) @@ -127,7 +128,7 @@ The following operations related to messages are defined for these semantic conv | Attribute | Type | Description | Examples | Required | |---|---|---|---|---| -| `messaging.system` | string | A string identifying the messaging system. | `kafka`; `rabbitmq`; `activemq`; `AmazonSQS` | Yes | +| `messaging.system` | string | A string identifying the messaging system. | `kafka`; `rabbitmq`; `rocketmq`; `activemq`; `AmazonSQS` | Yes | | `messaging.destination` | string | The message destination name. This might be equal to the span name but is required nevertheless. | `MyQueue`; `MyTopic` | Yes | | `messaging.destination_kind` | string | The kind of message destination | `queue` | Conditional [1] | | `messaging.temp_destination` | boolean | A boolean that is true if the message destination is temporary. | | If missing, it is assumed to be false. | @@ -217,6 +218,38 @@ For Apache Kafka producers, [`peer.service`](./span-general.md#general-remote-se The `service.name` of a Consumer's Resource SHOULD match the `peer.service` of the Producer, when the message is directly passed to another service. If an intermediary broker is present, `service.name` and `peer.service` will not be the same. +#### Apache RocketMQ + +Specific attributes for Apache RocketMQ are defined below. + + +| Attribute | Type | Description | Examples | Required | +|---|---|---|---|---| +| `messaging.rocketmq.namespace` | string | Namespace of RocketMQ resources, resources in different namespaces are individual. | `myNamespace` | Yes | +| `messaging.rocketmq.client_group` | string | Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. | `myConsumerGroup` | Yes | +| `messaging.rocketmq.client_id` | string | The unique identifier for each client. | `myhost@8742@s8083jm` | Yes | +| `messaging.rocketmq.message_type` | string | Type of message. | `normal` | No | +| `messaging.rocketmq.message_tag` | string | The secondary classifier of message besides topic. | `tagA` | No | +| `messaging.rocketmq.message_keys` | string[] | Key(s) of message, another way to mark message besides message id. | `[keyA, keyB]` | No | +| `messaging.rocketmq.consumption_model` | string | Model of message consumption. This only applies to consumer spans. | `clustering` | No | + +`messaging.rocketmq.message_type` MUST be one of the following: + +| Value | Description | +|---|---| +| `normal` | Normal message | +| `fifo` | FIFO message | +| `delay` | Delay message | +| `transaction` | Transaction message | + +`messaging.rocketmq.consumption_model` MUST be one of the following: + +| Value | Description | +|---|---| +| `clustering` | Clustering consumption model | +| `broadcasting` | Broadcasting consumption model | + + ## Examples ### Topic with multiple consumers