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 messaging.kafka.message.offset attribute #2982

Merged
merged 4 commits into from
Dec 1, 2022
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ release.
- Rename `rpc.request.metadata.<key>` and `rpc.response.metadata.<key>` to
`rpc.grpc.request.metadata.<key>` and `rpc.grpc.response.metadata.<key>`
([#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

Expand Down
5 changes: 5 additions & 0 deletions semantic_conventions/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ groups:
brief: >
Partition the message is sent to.
examples: 2
- id: message.offset
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
type: int
brief: >
The offset of a record in the corresponding Kafka partition.
examples: 42
- id: tombstone
type: boolean
requirement_level:
Expand Down
4 changes: 3 additions & 1 deletion specification/trace/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down