Skip to content

Provide sleuth tracing on all factory methods of KafkaListenerContainerFactory #1664

@fromlabs

Description

@fromlabs

Version: spring-cloud-sleuth-core-2.2.2.RELEASE.jar

Actually MessageListenerContainer creation is intercepted thanks to a pointcut defined in SleuthKafkaAspect on method KafkaListenerContainerFactory.createListenerContainer:

@Pointcut("execution(public * org.springframework.kafka.config.KafkaListenerContainerFactory.createListenerContainer(..))")
private void anyCreateListenerContainer() {
}

but from the reference documentation (link):

Starting with version 2.2, you can use the same factory to create any ConcurrentMessageListenerContainer

KafkaListenerContainerFactory exposes other factory methods:

// intercepted
C createListenerContainer(KafkaListenerEndpoint endpoint);

// not intercepted
C createContainer(TopicPartitionOffset... topicPartitions);
C createContainer(String... topics);
C createContainer(Pattern topicPattern);

Can you add pointcuts also on createContainer(..) methods with the same tracing logic?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions