-
Notifications
You must be signed in to change notification settings - Fork 782
Closed
Labels
Description
I need a way to get span in Kafka ErrorHanlder. I do the next thing in error handler -
@Override
public void handle(Exception ex, ConsumerRecord<?, ?> consumerRecord) {
var curSpan = this.kafkaTracing.nextSpan(consumerRecord).name("on-message").start()
try (Tracer.SpanInScope ws = tracer.withSpanInScope(curSpan)) {
log.error(ex);
} finally {
span.finish();
}
}
But method in KafkaTracing nextSpan() - clear all headers before error handler do its job. And KafkaTracing if final and i can't inherit from it. I have a question - is it a bug that you don't give an opportunity not to remove headers from ConsumerRecord?