Class SpringKafkaTelemetry

java.lang.Object
io.opentelemetry.instrumentation.spring.kafka.v2_7.SpringKafkaTelemetry

public final class SpringKafkaTelemetry extends Object
Entrypoint for instrumenting Spring Kafka listeners.
  • Method Summary

    Modifier and Type
    Method
    Description
    builder(io.opentelemetry.api.OpenTelemetry openTelemetry)
    Returns a new SpringKafkaTelemetryBuilder configured with the given OpenTelemetry.
    create(io.opentelemetry.api.OpenTelemetry openTelemetry)
    Returns a new SpringKafkaTelemetry configured with the given OpenTelemetry.
    <K, V> org.springframework.kafka.listener.BatchInterceptor<K,V>
    Returns a new BatchInterceptor that decorates a message listener with a CONSUMER span.
    <K, V> org.springframework.kafka.listener.BatchInterceptor<K,V>
    createBatchInterceptor(org.springframework.kafka.listener.BatchInterceptor<K,V> decoratedInterceptor)
    Returns a new BatchInterceptor that decorates a message listener with a CONSUMER span, and then delegates to a provided decoratedInterceptor.
    <K, V> org.springframework.kafka.listener.RecordInterceptor<K,V>
    Returns a new RecordInterceptor that decorates a message listener with a CONSUMER span.
    <K, V> org.springframework.kafka.listener.RecordInterceptor<K,V>
    createRecordInterceptor(org.springframework.kafka.listener.RecordInterceptor<K,V> decoratedInterceptor)
    Returns a new RecordInterceptor that decorates a message listener with a CONSUMER span, and then delegates to a provided decoratedInterceptor.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static SpringKafkaTelemetry create(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns a new SpringKafkaTelemetry configured with the given OpenTelemetry.
    • builder

      public static SpringKafkaTelemetryBuilder builder(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns a new SpringKafkaTelemetryBuilder configured with the given OpenTelemetry.
    • createRecordInterceptor

      public <K, V> org.springframework.kafka.listener.RecordInterceptor<K,V> createRecordInterceptor()
      Returns a new RecordInterceptor that decorates a message listener with a CONSUMER span. Can be set on a AbstractMessageListenerContainer using the AbstractMessageListenerContainer.setRecordInterceptor(RecordInterceptor) method.
    • createRecordInterceptor

      public <K, V> org.springframework.kafka.listener.RecordInterceptor<K,V> createRecordInterceptor(org.springframework.kafka.listener.RecordInterceptor<K,V> decoratedInterceptor)
      Returns a new RecordInterceptor that decorates a message listener with a CONSUMER span, and then delegates to a provided decoratedInterceptor. Can be set on a AbstractMessageListenerContainer using the AbstractMessageListenerContainer.setRecordInterceptor(RecordInterceptor) method.
    • createBatchInterceptor

      public <K, V> org.springframework.kafka.listener.BatchInterceptor<K,V> createBatchInterceptor()
      Returns a new BatchInterceptor that decorates a message listener with a CONSUMER span. Can be set on a AbstractMessageListenerContainer using the AbstractMessageListenerContainer.setBatchInterceptor(BatchInterceptor) method.
    • createBatchInterceptor

      public <K, V> org.springframework.kafka.listener.BatchInterceptor<K,V> createBatchInterceptor(org.springframework.kafka.listener.BatchInterceptor<K,V> decoratedInterceptor)
      Returns a new BatchInterceptor that decorates a message listener with a CONSUMER span, and then delegates to a provided decoratedInterceptor. Can be set on a AbstractMessageListenerContainer using the AbstractMessageListenerContainer.setBatchInterceptor(BatchInterceptor) method.