Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add specific attributes for Apache RocketMQ #1904

Merged
merged 1 commit into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
67 changes: 66 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,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
Oberon00 marked this conversation as resolved.
Show resolved Hide resolved
type: string
required: always
brief: >
The unique identifier for each client.
examples: 'myhost@8742@s8083jm'
- id: message_type
aaron-ai marked this conversation as resolved.
Show resolved Hide resolved
type:
allow_custom_values: false
aaron-ai marked this conversation as resolved.
Show resolved Hide resolved
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
aaron-ai marked this conversation as resolved.
Show resolved Hide resolved
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
aaron-ai marked this conversation as resolved.
Show resolved Hide resolved
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.
35 changes: 34 additions & 1 deletion specification/trace/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -127,7 +128,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 +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
arminru marked this conversation as resolved.
Show resolved Hide resolved

Specific attributes for Apache RocketMQ are defined below.

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

## Examples

### Topic with multiple consumers
Expand Down