Class KafkaConsumerContextUtil

java.lang.Object
io.opentelemetry.instrumentation.kafkaclients.common.v0_11.internal.KafkaConsumerContextUtil

public final class KafkaConsumerContextUtil extends Object
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    copy(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> from, org.apache.kafka.clients.consumer.ConsumerRecord<?,?> to)
     
    create(io.opentelemetry.context.Context context, String consumerGroup, String clientId, String clusterId)
     
    create(io.opentelemetry.context.Context context, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
     
    get(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> records)
     
    get(org.apache.kafka.clients.consumer.ConsumerRecords<?,?> records)
     
    getRawProcessingEligibility(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record)
     
    static List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>>
    getRecords(org.apache.kafka.clients.consumer.ConsumerRecords<?,?> records)
    Reads batch membership without invoking tracing iterators.
    static boolean
    hasReceiveOperation(io.opentelemetry.context.Context context)
     
    static boolean
    markConsumedMessageCounted(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record)
    Returns true the first time the given record is seen, and false afterwards, so that operations that observe the same record do not count it twice.
    static void
    set(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, KafkaConsumerContext consumerContext)
     
    static void
    set(org.apache.kafka.clients.consumer.ConsumerRecords<?,?> records, KafkaConsumerContext consumerContext)
     
    static void
    setRawProcessingEligibility(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, BooleanSupplier rawProcessingEligibility)
     
    static io.opentelemetry.context.Context
    spanSuppressionContext(io.opentelemetry.context.Context context)
    Checks a distinct Kafka operation without treating an ambient consumer as its owner.
    static io.opentelemetry.context.Context
    withoutLeakedProcessSpan(io.opentelemetry.context.Context context)
     
    static io.opentelemetry.context.Scope
    Keeps legacy upstream extraction from seeing an abandoned raw Process scope.
    static io.opentelemetry.context.Context
    withProcessParentSpan(io.opentelemetry.context.Context context, io.opentelemetry.context.Context parentContext)
     
    static io.opentelemetry.context.Context
    withReceiveOperation(io.opentelemetry.context.Context context, boolean receiveOperation)
     

    Methods inherited from class Object

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

    • spanSuppressionContext

      public static io.opentelemetry.context.Context spanSuppressionContext(io.opentelemetry.context.Context context)
      Checks a distinct Kafka operation without treating an ambient consumer as its owner.
    • withoutLeakedProcessSpan

      public static io.opentelemetry.context.Context withoutLeakedProcessSpan(io.opentelemetry.context.Context context)
    • withoutLeakedProcessSpanDuringExtraction

      @Nullable public static io.opentelemetry.context.Scope withoutLeakedProcessSpanDuringExtraction()
      Keeps legacy upstream extraction from seeing an abandoned raw Process scope.
    • withProcessParentSpan

      public static io.opentelemetry.context.Context withProcessParentSpan(io.opentelemetry.context.Context context, io.opentelemetry.context.Context parentContext)
    • withReceiveOperation

      public static io.opentelemetry.context.Context withReceiveOperation(io.opentelemetry.context.Context context, boolean receiveOperation)
    • hasReceiveOperation

      public static boolean hasReceiveOperation(io.opentelemetry.context.Context context)
    • markConsumedMessageCounted

      public static boolean markConsumedMessageCounted(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record)
      Returns true the first time the given record is seen, and false afterwards, so that operations that observe the same record do not count it twice.
    • setRawProcessingEligibility

      public static void setRawProcessingEligibility(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, BooleanSupplier rawProcessingEligibility)
    • getRawProcessingEligibility

      @Nullable public static BooleanSupplier getRawProcessingEligibility(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record)
    • getRecords

      public static List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> getRecords(org.apache.kafka.clients.consumer.ConsumerRecords<?,?> records)
      Reads batch membership without invoking tracing iterators.
    • get

      public static KafkaConsumerContext get(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> records)
    • get

      public static KafkaConsumerContext get(org.apache.kafka.clients.consumer.ConsumerRecords<?,?> records)
    • create

      public static KafkaConsumerContext create(@Nullable io.opentelemetry.context.Context context, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
    • create

      public static KafkaConsumerContext create(@Nullable io.opentelemetry.context.Context context, @Nullable String consumerGroup, @Nullable String clientId, @Nullable String clusterId)
    • set

      public static void set(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, KafkaConsumerContext consumerContext)
    • set

      public static void set(org.apache.kafka.clients.consumer.ConsumerRecords<?,?> records, KafkaConsumerContext consumerContext)
    • copy

      public static void copy(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> from, org.apache.kafka.clients.consumer.ConsumerRecord<?,?> to)