From d6190879533fd16b7878226551c782b88b5d10af Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Wed, 23 Nov 2022 10:28:56 +0100 Subject: [PATCH 1/3] Add `messaging.kafka.message.offset` attribute --- semantic_conventions/trace/messaging.yaml | 5 +++++ specification/trace/semantic_conventions/messaging.md | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/semantic_conventions/trace/messaging.yaml b/semantic_conventions/trace/messaging.yaml index f50844a8a95..ff917a05091 100644 --- a/semantic_conventions/trace/messaging.yaml +++ b/semantic_conventions/trace/messaging.yaml @@ -189,6 +189,11 @@ groups: brief: > Partition the message is sent to. examples: 2 + - id: message.offset + type: int + brief: > + The offset of a record in the corresponding Kafka partition. + examples: 42 - id: tombstone type: boolean requirement_level: diff --git a/specification/trace/semantic_conventions/messaging.md b/specification/trace/semantic_conventions/messaging.md index c11b4fd5c6e..faecbe03658 100644 --- a/specification/trace/semantic_conventions/messaging.md +++ b/specification/trace/semantic_conventions/messaging.md @@ -280,6 +280,7 @@ For Apache Kafka, the following additional attributes are defined: | `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 | | `messaging.kafka.client_id` | string | Client Id for the Consumer or Producer that is handling the message. | `client-5` | Recommended | | `messaging.kafka.partition` | int | Partition the message is sent to. | `2` | Recommended | +| `messaging.kafka.message.offset` | int | The offset of a record in the corresponding Kafka partition. | `42` | Recommended | | `messaging.kafka.tombstone` | boolean | A boolean that is true if the message is a tombstone. | | Conditionally Required: [2] | **[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. @@ -395,7 +396,8 @@ Process CB: | Span Rcv2 | | `messaging.kafka.message_key` | `"myKey"` | `"myKey"` | `"myKey"` | `"anotherKey"` | `"anotherKey"` | | `messaging.kafka.consumer_group` | | `"my-group"` | `"my-group"` | | `"another-group"` | | `messaging.kafka.client_id` | | `"5"` | `"5"` | `"5"` | `"8"` | -| `messaging.kafka.partition` | | `"1"` | `"1"` | | `"3"` | +| `messaging.kafka.partition` | `"1"` | `"1"` | `"1"` | `"3"` | `"3"` | +| `messaging.kafka.message.offset` | `"12"` | `"12"` | `"12"` | `"32"` | `"32"` | ### Batch receiving From 0bae95bd0d2c10af3f8046a3e0e94d34e7bcfaf1 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Wed, 23 Nov 2022 10:32:20 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06a9acd224e..5410d62138b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ release. ### Traces +- Add `messaging.kafka.message.offset` attribute. + ([#2982](https://github.com/open-telemetry/opentelemetry-specification/pull/2982)) + ### Metrics - Define Experimental MetricProducer as a third-party provider of metric data to MetricReaders. From 5b049951a51c4c6a58a20f4b587a771f4ba3a2a7 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Wed, 30 Nov 2022 09:28:05 +0100 Subject: [PATCH 3/3] fix changelog --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5410d62138b..3f6fdffff32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,6 @@ release. ### Traces -- Add `messaging.kafka.message.offset` attribute. - ([#2982](https://github.com/open-telemetry/opentelemetry-specification/pull/2982)) - ### Metrics - Define Experimental MetricProducer as a third-party provider of metric data to MetricReaders. @@ -36,6 +33,8 @@ release. - Rename `rpc.request.metadata.` and `rpc.response.metadata.` to `rpc.grpc.request.metadata.` and `rpc.grpc.response.metadata.` ([#2981](https://github.com/open-telemetry/opentelemetry-specification/pull/2981)) +- Add `messaging.kafka.message.offset` attribute. + ([#2982](https://github.com/open-telemetry/opentelemetry-specification/pull/2982)) ### Compatibility