Class OpenTelemetryConsumerInterceptor<K,V>

java.lang.Object
io.opentelemetry.instrumentation.kafkaclients.v2_6.internal.OpenTelemetryConsumerInterceptor<K,V>
All Implemented Interfaces:
AutoCloseable, org.apache.kafka.clients.consumer.ConsumerInterceptor<K,V>, org.apache.kafka.common.Configurable

public class OpenTelemetryConsumerInterceptor<K,V> extends Object implements org.apache.kafka.clients.consumer.ConsumerInterceptor<K,V>
A ConsumerInterceptor 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_CONSUMER_TELEMETRY_SUPPLIER

      public static final String CONFIG_KEY_KAFKA_CONSUMER_TELEMETRY_SUPPLIER
      See Also:
  • Constructor Details

    • OpenTelemetryConsumerInterceptor

      public OpenTelemetryConsumerInterceptor()
  • Method Details

    • onConsume

      @CanIgnoreReturnValue public org.apache.kafka.clients.consumer.ConsumerRecords<K,V> onConsume(org.apache.kafka.clients.consumer.ConsumerRecords<K,V> records)
      Specified by:
      onConsume in interface org.apache.kafka.clients.consumer.ConsumerInterceptor<K,V>
    • onCommit

      public void onCommit(Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)
      Specified by:
      onCommit in interface org.apache.kafka.clients.consumer.ConsumerInterceptor<K,V>
    • close

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

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