Skip to content

Commit bb6e939

Browse files
author
Liudmila Molkova
committed
move routing_key and partition to destination
1 parent 1aee94e commit bb6e939

File tree

4 files changed

+41
-16
lines changed

4 files changed

+41
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ release.
5757
`messaging.conversation_id` to `messaging.message.conversation_id`,
5858
`messaging.message_payload_size_bytes` to `messaging.message.payload_size_bytes`,
5959
`messaging.message_payload_compressed_size_bytes` to `messaging.message.payload_compressed_size_bytes`,
60-
`messaging.rabbitmq.routing_key`: `messaging.rabbitmq.message.routing_key`,
60+
`messaging.rabbitmq.routing_key`: `messaging.rabbitmq.destination.routing_key`,
6161
`messaging.kafka.message_key` to `messaging.kafka.message.key`,
62-
`messaging.kafka.partition` to `messaging.kafka.message.partition`,
62+
`messaging.kafka.partition` to `messaging.kafka.destination.partition`,
6363
`messaging.kafka.tombstone` to `messaging.kafka.message.tombstone`,
6464
`messaging.rocketmq.message_type` to `messaging.rocketmq.message.type`,
6565
`messaging.rocketmq.message_tag` to `messaging.rocketmq.message.tag`,

schemas/1.16.0

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ versions:
1616
messaging.conversation_id: messaging.message.conversation_id
1717
messaging.message_payload_size_bytes: messaging.message.payload_size_bytes
1818
messaging.message_payload_compressed_size_bytes: messaging.message.payload_compressed_size_bytes
19-
messaging.rabbitmq.routing_key: messaging.rabbitmq.message.routing_key
19+
messaging.rabbitmq.routing_key: messaging.rabbitmq.destination.routing_key
2020
messaging.kafka.message_key: messaging.kafka.message.key
21-
messaging.kafka.partition: messaging.kafka.message.partition
21+
messaging.kafka.partition: messaging.kafka.destination.partition
2222
messaging.kafka.tombstone: messaging.kafka.message.tombstone
2323
messaging.rocketmq.message_type: messaging.rocketmq.message.type
2424
messaging.rocketmq.message_tag: messaging.rocketmq.message.tag

semantic_conventions/trace/messaging.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ groups:
6666
brief: >
6767
A string identifying the kind of messaging operation as defined in the
6868
[Operation names](#operation-names) section above.
69-
note: If custom value is used, it MUST known to be of low cardinality.
69+
note: If a custom value is used, it MUST known to be of low cardinality.
7070
- id: batch.size
7171
type: int
7272
brief: The number of messages sent, received, or processed in the scope of the batching operation.
@@ -221,6 +221,18 @@ groups:
221221
requirement_level:
222222
recommended: when supported by messaging system and only if the source is anonymous. If missing, assumed to be false.
223223
brief: 'A boolean that is true if the message source is anonymous (could be unnamed or have auto-generated name).'
224+
- ref: messaging.destination.name
225+
requirement_level:
226+
recommended: If known on consumer
227+
- ref: messaging.destination.kind
228+
requirement_level:
229+
recommended: If known on consumer
230+
- ref: messaging.destination.temporary
231+
requirement_level:
232+
recommended: If known on consumer
233+
- ref: messaging.destination.anonymous
234+
requirement_level:
235+
recommended: If known on consumer
224236

225237
- id: messaging.consumer.synchronous
226238
prefix: messaging
@@ -238,7 +250,7 @@ groups:
238250
brief: >
239251
Attributes for RabbitMQ
240252
attributes:
241-
- id: message.routing_key
253+
- id: destination.routing_key
242254
type: string
243255
requirement_level:
244256
conditionally_required: If not empty.
@@ -274,11 +286,16 @@ groups:
274286
brief: >
275287
Client Id for the Consumer or Producer that is handling the message.
276288
examples: 'client-5'
277-
- id: message.partition
289+
- id: destination.partition
278290
type: int
279291
brief: >
280292
Partition the message is sent to.
281293
examples: 2
294+
- id: source.partition
295+
type: int
296+
brief: >
297+
Partition the message is received from.
298+
examples: 2
282299
- id: message.tombstone
283300
type: boolean
284301
requirement_level:

specification/trace/semantic_conventions/messaging.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The destination name SHOULD only be used for the span name if it is known to be
155155
This can be assumed if it is statically derived from application code or configuration.
156156
Wherever possible, the real destination names after resolving logical or aliased names SHOULD be used.
157157
If the destination name is dynamic, such as a [conversation ID](#conversations) or a value obtained from a `Reply-To` header, it SHOULD NOT be used for the span name.
158-
In these cases, an artificial destination name that best expresses the destination, or a generic, static fallback like `"(anonymous)"` for [anonymous destinations](#temporary-and-anonymous-destinations) SHOULD be used instead.anonymous
158+
In these cases, an artificial destination name that best expresses the destination, or a generic, static fallback like `"(anonymous)"` for [anonymous destinations](#temporary-and-anonymous-destinations) SHOULD be used instead.
159159

160160
The values allowed for `<operation name>` are defined in the section [Operation names](#operation-names) below.
161161
If the format above is used, the operation name MUST match the `messaging.operation` attribute defined for message consumer spans below.
@@ -206,7 +206,7 @@ The following operations related to messages are defined for these semantic conv
206206
| [`net.sock.peer.name`](span-general.md) | string | Remote socket peer name. | `proxy.example.com` | Recommended: [11] |
207207
| [`net.sock.peer.port`](span-general.md) | int | Remote socket peer port. | `16456` | Recommended: [12] |
208208

209-
**[1]:** If custom value is used, it MUST known to be of low cardinality.
209+
**[1]:** If a custom value is used, it MUST known to be of low cardinality.
210210

211211
**[2]:** Instrumentations SHOULD NOT set `messaging.batch.size` on spans that operate with a single message. When client library supports batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.size` for batching APIs and SHOULD NOT use it for single-message APIs.
212212

@@ -253,7 +253,7 @@ logical entity messages are received from. Attributes in `messaging.batch` names
253253

254254
### Producer attributes
255255

256-
Following additional attributes describe message producer operations.
256+
The following additional attributes describe message producer operations.
257257

258258
<!-- semconv messaging.producer -->
259259
| Attribute | Type | Description | Examples | Requirement Level |
@@ -289,7 +289,7 @@ broker does not have such notion, destination name SHOULD uniquely identify brok
289289

290290
### Consumer attributes
291291

292-
Following additional attributes describe message consumer operations.
292+
The following additional attributes describe message consumer operations.
293293

294294
<!-- semconv messaging.consumer -->
295295
| Attribute | Type | Description | Examples | Requirement Level |
@@ -299,7 +299,11 @@ Following additional attributes describe message consumer operations.
299299
| `messaging.source.template` | string | Low cardinality field representing messaging source [2] | `/customers/{customerId}` | Conditionally Required: [3] |
300300
| `messaging.source.temporary` | boolean | A boolean that is true if the message source is temporary and might not exist anymore after messages are processed. | | Recommended: [4] |
301301
| `messaging.source.anonymous` | boolean | A boolean that is true if the message source is anonymous (could be unnamed or have auto-generated name). | | Recommended: [5] |
302-
| `messaging.source.name` | string | The message source name [6] | `MyQueue`; `MyTopic` | Conditionally Required: [7] |
302+
| `messaging.destination.anonymous` | boolean | A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). | | Recommended: If known on consumer |
303+
| `messaging.destination.kind` | string | The kind of message destination | `queue` | Recommended: If known on consumer |
304+
| `messaging.destination.name` | string | The message destination name [6] | `MyQueue`; `MyTopic` | Recommended: If known on consumer |
305+
| `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | Recommended: If known on consumer |
306+
| `messaging.source.name` | string | The message source name [7] | `MyQueue`; `MyTopic` | Conditionally Required: [8] |
303307

304308
**[1]:** If the message source is either a `queue` or `topic`.
305309

@@ -311,10 +315,13 @@ Following additional attributes describe message consumer operations.
311315

312316
**[5]:** when supported by messaging system and only if the source is anonymous. If missing, assumed to be false.
313317

314-
**[6]:** Source name SHOULD uniquely identify specific queue, topic, or other entity within broker. If
318+
**[6]:** Destination name SHOULD uniquely identify specific queue, topic, or other entity within broker. If
319+
broker does not have such notion, destination name SHOULD uniquely identify broker.
320+
321+
**[7]:** Source name SHOULD uniquely identify specific queue, topic, or other entity within broker. If
315322
broker does not have such notion, source name SHOULD uniquely identify broker.
316323

317-
**[7]:** If the value applies to all messages in the batch.
324+
**[8]:** If the value applies to all messages in the batch.
318325

319326
`messaging.source.kind` 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.
320327

@@ -358,7 +365,7 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*.
358365
<!-- semconv messaging.rabbitmq -->
359366
| Attribute | Type | Description | Examples | Requirement Level |
360367
|---|---|---|---|---|
361-
| `messaging.rabbitmq.message.routing_key` | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. |
368+
| `messaging.rabbitmq.destination.routing_key` | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. |
362369
<!-- endsemconv -->
363370

364371
#### Apache Kafka
@@ -371,7 +378,8 @@ For Apache Kafka, the following additional attributes are defined:
371378
| `messaging.kafka.message.key` | string | Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. [1] | `myKey` | Recommended |
372379
| `messaging.kafka.consumer_group` | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` | Recommended |
373380
| `messaging.kafka.client_id` | string | Client Id for the Consumer or Producer that is handling the message. | `client-5` | Recommended |
374-
| `messaging.kafka.message.partition` | int | Partition the message is sent to. | `2` | Recommended |
381+
| `messaging.kafka.destination.partition` | int | Partition the message is sent to. | `2` | Recommended |
382+
| `messaging.kafka.source.partition` | int | Partition the message is received from. | `2` | Recommended |
375383
| `messaging.kafka.message.tombstone` | boolean | A boolean that is true if the message is a tombstone. | | Conditionally Required: [2] |
376384

377385
**[1]:** 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.

0 commit comments

Comments
 (0)