From 4b4adc684cca7858091a92751611424358969032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=8C=E6=A5=9A?= Date: Thu, 2 Sep 2021 20:40:07 +0800 Subject: [PATCH] Add specific attributes for Apache RocketMQ --- semantic_conventions/trace/messaging.yaml | 63 ++++++++++++++++++- .../trace/semantic_conventions/messaging.md | 21 ++++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/semantic_conventions/trace/messaging.yaml b/semantic_conventions/trace/messaging.yaml index 03c8baeb176..59b30645598 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,64 @@ 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: version + type: string + required: always + brief: > + Version of RocketMQ. + examples: '5.0.0' + - id: namespace + type: string + required: always + brief: > + Namespace of RocketMQ resources, resources in different namespace are individual. + examples: 'myNamespace' + - id: group + type: string + required: always + brief: > + Name of the RocketMQ producer/consumer group that is handling the message, the client type could be indentified by spanKind. + examples: 'myConsumerGroup' + - id: client_id + type: string + required: always + brief: > + The unique idendifier for each client. + examples: 'myhost@8742@s8083jm' + - id: message_type + type: string + brief: > + Type of message. + examples: ['normal', 'fifo', 'delay', 'transaction'] + - id: message_tag + type: string + brief: > + The secondary classifier of message besides topic. + examples: tagA + - id: message_keys + type: string + brief: > + Key of message, which is unique generally, would split by blank space if more than one. + examples: keyA + - id: consumption_model + type: string + brief: > + Mode of message consumption. + examples: ['clustering', "broadcasting"] + - id: attempt + type: int + brief: > + The attempt times of corresponding operation. The minimum attempt times is 1. + examples: 3 + - id: batch_size + type: int + brief: > + The batch size of corresponding operation. The minimum size is 1. + examples: 1 diff --git a/specification/trace/semantic_conventions/messaging.md b/specification/trace/semantic_conventions/messaging.md index 41c2341bb4f..814dd7c0e6a 100644 --- a/specification/trace/semantic_conventions/messaging.md +++ b/specification/trace/semantic_conventions/messaging.md @@ -127,7 +127,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 +217,25 @@ 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.version` | string | Version of RocketMQ. | `5.0.0` | Yes | +| `messaging.rocketmq.namespace` | string | Namespace of RocketMQ resources, resources in different namespace are individual. | `myNamespace` | Yes | +| `messaging.rocketmq.group` | string | Name of the RocketMQ producer/consumer group that is handling the message, the client type could be indentified by spanKind. | `myConsumerGroup` | Yes | +| `messaging.rocketmq.client_id` | string | The unique idendifier for each client. | `myhost@8742@s8083jm` | Yes | +| `messaging.rocketmq.message_type` | string | Type of message. | `normal`; `fifo`; `delay`; `transaction` | No | +| `messaging.rocketmq.message_tag` | string | The secondary classifier of message besides topic. | `tagA` | No | +| `messaging.rocketmq.message_keys` | string | Key of message, which is unique generally, would split by blank space if more than one. | `keyA` | No | +| `messaging.rocketmq.consumption_model` | string | Mode of message consumption. | `clustering`; `broadcasting` | No | +| `messaging.rocketmq.attempt` | int | The attempt times of corresponding operation. The minimum attempt times is 1. | `3` | No | +| `messaging.rocketmq.batch_size` | int | The batch size of corresponding operation. The minimum size is 1. | `1` | No | + + ## Examples ### Topic with multiple consumers