Class TracingProducerInterceptor<K,V>

java.lang.Object
io.opentelemetry.instrumentation.kafkaclients.v2_6.TracingProducerInterceptor<K,V>
All Implemented Interfaces:
org.apache.kafka.clients.producer.ProducerInterceptor<K,V>, org.apache.kafka.common.Configurable

public class TracingProducerInterceptor<K,V> extends Object implements org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
A ProducerInterceptor that adds tracing capability. Add this interceptor's class name or class via ProducerConfig.INTERCEPTOR_CLASSES_CONFIG property to your Producer's properties to get it instantiated and used. See more details on ProducerInterceptor usage in its Javadoc.
  • Constructor Details

    • TracingProducerInterceptor

      public TracingProducerInterceptor()
  • Method Details

    • onSend

      @CanIgnoreReturnValue public org.apache.kafka.clients.producer.ProducerRecord<K,V> onSend(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord)
      Specified by:
      onSend in interface org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
    • onAcknowledgement

      public void onAcknowledgement(org.apache.kafka.clients.producer.RecordMetadata recordMetadata, Exception e)
      Specified by:
      onAcknowledgement in interface org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
    • close

      public void close()
      Specified by:
      close in interface org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
    • configure

      public void configure(Map<String,?> map)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable