Class SentryKafkaProducerBeanPostProcessor

java.lang.Object
io.sentry.spring7.kafka.SentryKafkaProducerBeanPostProcessor
All Implemented Interfaces:
BeanPostProcessor, Ordered, PriorityOrdered

@Internal public final class SentryKafkaProducerBeanPostProcessor extends Object implements BeanPostProcessor, PriorityOrdered
Installs a ProducerPostProcessor on every ProducerFactory bean so that each Producer created by Spring Kafka is wrapped via SentryKafkaProducer.wrap(Producer).

The wrapper records a queue.publish span around each send(...) that finishes when the broker ack callback fires, giving a real producer-send lifecycle span. KafkaTemplate beans are left untouched, so all customer-configured listeners, interceptors and observation settings are preserved.

Note: ProducerFactory.addPostProcessor(ProducerPostProcessor) is a default method on the interface that is a no-op unless overridden. Custom factories that do not extend DefaultKafkaProducerFactory will not receive Sentry producer instrumentation; a warning is logged at startup in that case.