Introduce common `messaging.destination.partition.id` instead of per-system ones (#798)

Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
This commit is contained in:
Liudmila Molkova 2024-03-13 03:42:47 -07:00 committed by GitHub
parent e24b332c18
commit e74c9982f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 49 additions and 23 deletions

4
.chloggen/798.yaml Normal file
View File

@ -0,0 +1,4 @@
change_type: breaking
component: messaging
note: Introduce common `messaging.destination.partition.id` instead of `messaging.kafka.destination.partition`
issues: [798]

View File

@ -12,6 +12,7 @@
- [RocketMQ Attributes](#rocketmq-attributes) - [RocketMQ Attributes](#rocketmq-attributes)
- [Azure Event Hubs Attributes](#azure-event-hubs-attributes) - [Azure Event Hubs Attributes](#azure-event-hubs-attributes)
- [Azure Service Bus Attributes](#azure-service-bus-attributes) - [Azure Service Bus Attributes](#azure-service-bus-attributes)
- [Deprecated Messaging Attributes](#deprecated-messaging-attributes)
<!-- tocstop --> <!-- tocstop -->
@ -24,6 +25,7 @@
| `messaging.client_id` | string | A unique identifier for the client that consumes or produces a message. | `client-5`; `myhost@8742@s8083jm` | | `messaging.client_id` | string | A unique identifier for the client that consumes or produces a message. | `client-5`; `myhost@8742@s8083jm` |
| `messaging.destination.anonymous` | boolean | A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). | | | `messaging.destination.anonymous` | boolean | A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). | |
| `messaging.destination.name` | string | The message destination name [2] | `MyQueue`; `MyTopic` | | `messaging.destination.name` | string | The message destination name [2] | `MyQueue`; `MyTopic` |
| `messaging.destination.partition.id` | string | The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. | `1` |
| `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [3] | `/customers/{customerId}` | | `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [3] | `/customers/{customerId}` |
| `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | | `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | |
| `messaging.destination_publish.anonymous` | boolean | A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). | | | `messaging.destination_publish.anonymous` | boolean | A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). | |
@ -93,7 +95,6 @@ size should be used.
| Attribute | Type | Description | Examples | | Attribute | Type | Description | Examples |
|---|---|---|---| |---|---|---|---|
| `messaging.kafka.consumer.group` | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` | | `messaging.kafka.consumer.group` | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` |
| `messaging.kafka.destination.partition` | int | Partition the message is sent to. | `2` |
| `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` | | `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` |
| `messaging.kafka.message.offset` | int | The offset of a record in the corresponding Kafka partition. | `42` | | `messaging.kafka.message.offset` | int | The offset of a record in the corresponding Kafka partition. | `42` |
| `messaging.kafka.message.tombstone` | boolean | A boolean that is true if the message is a tombstone. | | | `messaging.kafka.message.tombstone` | boolean | A boolean that is true if the message is a tombstone. | |
@ -148,7 +149,6 @@ size should be used.
| Attribute | Type | Description | Examples | | Attribute | Type | Description | Examples |
|---|---|---|---| |---|---|---|---|
| `messaging.eventhubs.consumer.group` | string | The name of the consumer group the event consumer is associated with. | `indexer` | | `messaging.eventhubs.consumer.group` | string | The name of the consumer group the event consumer is associated with. | `indexer` |
| `messaging.eventhubs.destination.partition.id` | string | The identifier of the partition messages are sent to or received from, unique to the Event Hub which contains it. | `1` |
| `messaging.eventhubs.message.enqueued_time` | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` | | `messaging.eventhubs.message.enqueued_time` | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` |
<!-- endsemconv --> <!-- endsemconv -->
@ -171,3 +171,11 @@ size should be used.
| `dead_letter` | Message is sent to dead letter queue | | `dead_letter` | Message is sent to dead letter queue |
| `defer` | Message is deferred | | `defer` | Message is deferred |
<!-- endsemconv --> <!-- endsemconv -->
## Deprecated Messaging Attributes
<!-- semconv attributes.messaging.deprecated(omit_requirement_level) -->
| Attribute | Type | Description | Examples |
|---|---|---|---|
| `messaging.kafka.destination.partition` | int | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>"Deprecated, use `messaging.destination.partition.id` instead." | `2` |
<!-- endsemconv -->

View File

@ -54,8 +54,8 @@ The following additional attributes are defined:
<!-- semconv messaging.eventhubs --> <!-- semconv messaging.eventhubs -->
| Attribute | Type | Description | Examples | Requirement Level | | Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---| |---|---|---|---|---|
| [`messaging.destination.partition.id`](../attributes-registry/messaging.md) | string | "String representation of the partition id messages are sent to or received from, unique within the Event Hub." | `1` | Conditionally Required: If available. |
| [`messaging.eventhubs.consumer.group`](../attributes-registry/messaging.md) | string | The name of the consumer group the event consumer is associated with. | `indexer` | Conditionally Required: If not default ("$Default"). | | [`messaging.eventhubs.consumer.group`](../attributes-registry/messaging.md) | string | The name of the consumer group the event consumer is associated with. | `indexer` | Conditionally Required: If not default ("$Default"). |
| [`messaging.eventhubs.destination.partition.id`](../attributes-registry/messaging.md) | string | The identifier of the partition messages are sent to or received from, unique to the Event Hub which contains it. | `1` | Conditionally Required: If available. |
| [`messaging.eventhubs.message.enqueued_time`](../attributes-registry/messaging.md) | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` | Recommended | | [`messaging.eventhubs.message.enqueued_time`](../attributes-registry/messaging.md) | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` | Recommended |
<!-- endsemconv --> <!-- endsemconv -->

View File

@ -27,8 +27,8 @@ For Apache Kafka, the following additional attributes are defined:
<!-- semconv messaging.kafka(full,tag=tech-specific-kafka) --> <!-- semconv messaging.kafka(full,tag=tech-specific-kafka) -->
| Attribute | Type | Description | Examples | Requirement Level | | Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---| |---|---|---|---|---|
| [`messaging.destination.partition.id`](../attributes-registry/messaging.md) | string | "String representation of the partition id the message (or batch) is sent to or received from."" | `1` | Recommended |
| [`messaging.kafka.consumer.group`](../attributes-registry/messaging.md) | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` | Recommended | | [`messaging.kafka.consumer.group`](../attributes-registry/messaging.md) | string | Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. | `my-group` | Recommended |
| [`messaging.kafka.destination.partition`](../attributes-registry/messaging.md) | int | Partition the message is sent to. | `2` | Recommended |
| [`messaging.kafka.message.key`](../attributes-registry/messaging.md) | 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 | | [`messaging.kafka.message.key`](../attributes-registry/messaging.md) | 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 |
| [`messaging.kafka.message.offset`](../attributes-registry/messaging.md) | int | The offset of a record in the corresponding Kafka partition. | `42` | Recommended | | [`messaging.kafka.message.offset`](../attributes-registry/messaging.md) | int | The offset of a record in the corresponding Kafka partition. | `42` | Recommended |
| [`messaging.kafka.message.tombstone`](../attributes-registry/messaging.md) | boolean | A boolean that is true if the message is a tombstone. | | Conditionally Required: [2] | | [`messaging.kafka.message.tombstone`](../attributes-registry/messaging.md) | boolean | A boolean that is true if the message is a tombstone. | | Conditionally Required: [2] |

View File

@ -0,0 +1,11 @@
groups:
- id: attributes.messaging.deprecated
type: attribute_group
brief: "Describes deprecated messaging attributes."
attributes:
- id: messaging.kafka.destination.partition
type: int
brief: >
"Deprecated, use `messaging.destination.partition.id` instead."
examples: 2
deprecated: "Replaced by `messaging.destination.partition.id`."

View File

@ -66,6 +66,13 @@ groups:
the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker.
examples: ['MyQueue', 'MyTopic'] examples: ['MyQueue', 'MyTopic']
tag: messaging-generic tag: messaging-generic
- id: destination.partition.id
type: string
stability: experimental
brief: >
The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.
examples: '1'
tag: messaging-generic
- id: kafka.consumer.group - id: kafka.consumer.group
type: string type: string
stability: experimental stability: experimental
@ -74,13 +81,6 @@ groups:
Only applies to consumers, not producers. Only applies to consumers, not producers.
examples: 'my-group' examples: 'my-group'
tag: tech-specific-kafka tag: tech-specific-kafka
- id: kafka.destination.partition
type: int
stability: experimental
brief: >
Partition the message is sent to.
examples: 2
tag: tech-specific-kafka
- id: kafka.message.key - id: kafka.message.key
type: string type: string
stability: experimental stability: experimental
@ -273,7 +273,7 @@ groups:
type: string type: string
stability: experimental stability: experimental
brief: > brief: >
The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. The ordering key for a given message. If the attribute is not present, the message does not have an ordering key.
examples: 'ordering_key' examples: 'ordering_key'
tag: tech-specific-gcp-pubsub tag: tech-specific-gcp-pubsub
- id: system - id: system
@ -362,13 +362,6 @@ groups:
The UTC epoch seconds at which the message has been accepted and stored in the entity. The UTC epoch seconds at which the message has been accepted and stored in the entity.
examples: 1701393730 examples: 1701393730
tag: tech-specific-eventhubs tag: tech-specific-eventhubs
- id: eventhubs.destination.partition.id
type: string
stability: experimental
brief: >
The identifier of the partition messages are sent to or received from, unique to the Event Hub which contains it.
examples: '1'
tag: tech-specific-eventhubs
- id: eventhubs.consumer.group - id: eventhubs.consumer.group
type: string type: string
stability: experimental stability: experimental

View File

@ -109,12 +109,14 @@ groups:
brief: > brief: >
Attributes for Apache Kafka Attributes for Apache Kafka
attributes: attributes:
- ref: messaging.destination.partition.id
brief: >
"String representation of the partition id the message (or batch) is sent to or received from.""
tag: tech-specific-kafka
- ref: messaging.kafka.message.key - ref: messaging.kafka.message.key
tag: tech-specific-kafka tag: tech-specific-kafka
- ref: messaging.kafka.consumer.group - ref: messaging.kafka.consumer.group
tag: tech-specific-kafka tag: tech-specific-kafka
- ref: messaging.kafka.destination.partition
tag: tech-specific-kafka
- ref: messaging.kafka.message.offset - ref: messaging.kafka.message.offset
tag: tech-specific-kafka tag: tech-specific-kafka
- ref: messaging.kafka.message.tombstone - ref: messaging.kafka.message.tombstone
@ -186,10 +188,12 @@ groups:
brief: > brief: >
Attributes for Azure Event Hubs Attributes for Azure Event Hubs
attributes: attributes:
- ref: messaging.eventhubs.message.enqueued_time - ref: messaging.destination.partition.id
- ref: messaging.eventhubs.destination.partition.id brief: >
"String representation of the partition id messages are sent to or received from, unique within the Event Hub."
requirement_level: requirement_level:
conditionally_required: If available. conditionally_required: If available.
- ref: messaging.eventhubs.message.enqueued_time
- ref: messaging.eventhubs.consumer.group - ref: messaging.eventhubs.consumer.group
requirement_level: requirement_level:
conditionally_required: If not default ("$Default"). conditionally_required: If not default ("$Default").

View File

@ -2,6 +2,12 @@ file_format: 1.1.0
schema_url: https://opentelemetry.io/schemas/next schema_url: https://opentelemetry.io/schemas/next
versions: versions:
next: next:
spans:
changes:
# https://github.com/open-telemetry/semantic-conventions/pull/798
- rename_attributes:
attribute_map:
messaging.kafka.destination.partition: messaging.destination.partition.id
metrics: metrics:
changes: changes:
# https://github.com/open-telemetry/semantic-conventions/pull/484 # https://github.com/open-telemetry/semantic-conventions/pull/484