Skip to content

Commit

Permalink
Add specific attributes for Apache RocketMQ
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-ai committed Sep 2, 2021
1 parent bb9e014 commit 4b4adc6
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
63 changes: 62 additions & 1 deletion semantic_conventions/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
21 changes: 20 additions & 1 deletion specification/trace/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The following operations related to messages are defined for these semantic conv
<!-- semconv messaging -->
| 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. |
Expand Down Expand Up @@ -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.

<!-- semconv messaging.rocketmq -->
| 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 |
<!-- endsemconv -->

## Examples

### Topic with multiple consumers
Expand Down

0 comments on commit 4b4adc6

Please sign in to comment.