opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

Adding support for Kafka partition key (based on OTEL attribute value)

Open nirb-s1 opened this issue 1 year ago • 10 comments

Component(s)

exporter/kafka

Is your feature request related to a problem? Please describe.

Currently the kafka exporter doesn't provide a way to define a partition key at all which means that messages aren't orders in kafka topic if topic includes multiple partitions.

If also means that if metrics are re-send due to timeouts, we are required to handle duplications on consumer side instead of using kafka compaction on topic option which is also based on partition key.

Describe the solution you'd like

Define in kafka exporter configuration an attribute that will be used as partition key, if not set use the existing default behaviour.

Example: Use attribute os.hostname as partition key, than all metrics of same hostname will arrive to same consumer eventually.

Describe alternatives you've considered

Without such capabilities, we are required to build dedup capabilities on consumer side

Additional context

No response

nirb-s1 avatar Nov 21 '23 13:11 nirb-s1