Class KafkaConsumerContextUtil
java.lang.Object
io.opentelemetry.instrumentation.kafkaclients.common.v0_11.internal.KafkaConsumerContextUtil
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 TypeMethodDescriptionstatic voidcopy(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> from, org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> to) static KafkaConsumerContextcreate(io.opentelemetry.context.Context context, String consumerGroup, String clientId, String clusterId) static KafkaConsumerContextcreate(io.opentelemetry.context.Context context, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer) static KafkaConsumerContextget(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> records) static KafkaConsumerContextget(org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records) static BooleanSuppliergetRawProcessingEligibility(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 booleanhasReceiveOperation(io.opentelemetry.context.Context context) static booleanmarkConsumedMessageCounted(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> record) Returnstruethe first time the given record is seen, andfalseafterwards, so that operations that observe the same record do not count it twice.static voidset(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> record, KafkaConsumerContext consumerContext) static voidset(org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, KafkaConsumerContext consumerContext) static voidsetRawProcessingEligibility(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> record, BooleanSupplier rawProcessingEligibility) static io.opentelemetry.context.ContextspanSuppressionContext(io.opentelemetry.context.Context context) Checks a distinct Kafka operation without treating an ambient consumer as its owner.static io.opentelemetry.context.ContextwithoutLeakedProcessSpan(io.opentelemetry.context.Context context) static io.opentelemetry.context.ScopeKeeps legacy upstream extraction from seeing an abandoned raw Process scope.static io.opentelemetry.context.ContextwithProcessParentSpan(io.opentelemetry.context.Context context, io.opentelemetry.context.Context parentContext) static io.opentelemetry.context.ContextwithReceiveOperation(io.opentelemetry.context.Context context, boolean receiveOperation)
-
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
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) Returnstruethe first time the given record is seen, andfalseafterwards, 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
-
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)
-