open-telemetry / semantic-conventions

Defines standards for generating consistent, accessible telemetry across a variety of domains
Apache License 2.0
231 stars 146 forks source link

Should `messaging.kafka.message.offset` be in the message namespace? #1156

Closed lmolkova closed 4 days ago

lmolkova commented 1 month ago

Kafka settlement is offset-based.

When reporting settlement, we'd want to include messaging.kafka.message.offset on the settlement span as shown in https://github.com/open-telemetry/semantic-conventions/pull/1155. But that span does not have to be reported per message (it can be done in the background periodically, for each 1000th message, etc).

It looks weird to have the offset attribute in the message namespace as it's not just a message property, but also a thing on its own. Someone may also want to create a metric for the offset (e.g. latest published offset vs latest consumed offset would show the size of the queue). In this case it's rather a property of the topic/consumer group.

Suggesting messaging.kafka.offset or even a more generic one messaging.offset since offset concept is popular in messaging world.

pyohannes commented 1 month ago

I'm in favor of making this a generic attribute (outside the kafka namespace).

I have no strong opinion whether it should be messaging.offset or messaging.message.offset. I'd have a slight preference for messaging.offset because it's shorter.

lmolkova commented 4 weeks ago

Related: #1036

lmolkova commented 4 weeks ago

Did some research on the terminology used by different messaging systems:

lmolkova commented 4 weeks ago

Based on this, I would prefer messaging.kafka.offset, messaging.eventhubs.offset (future), messaging.rabbitmq.offset (if needed)

pyohannes commented 1 week ago

Discussed in the workgroup meeting, we will go with the proposal from @lmolkova in the previous comment.