Class OpenTelemetryProducerInterceptor<K,V>

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

public class OpenTelemetryProducerInterceptor<K,V> extends Object implements org.apache.kafka.clients.producer.ProducerInterceptor<K,V>
A ProducerInterceptor that adds OpenTelemetry instrumentation.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Field Details

    • CONFIG_KEY_KAFKA_PRODUCER_TELEMETRY_SUPPLIER

      public static final String CONFIG_KEY_KAFKA_PRODUCER_TELEMETRY_SUPPLIER
      See Also:
  • Constructor Details

    • OpenTelemetryProducerInterceptor

      public OpenTelemetryProducerInterceptor()
  • 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,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable