opentelemetry-collector-contrib
opentelemetry-collector-contrib copied to clipboard
Adding support for Kafka partition key (based on OTEL attribute value)
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