jalogar
jalogar

Reputation: 1684

zipkin asynch span every second

We have a spring-boot application (spring-boot-starter-parent-2.0.0.RELEASE) using spring-cloud-starter-zipkin for writing "spans" to zipkin.

We use spring-integration too (through spring-boot-starter-integration) and we have added an integration flow with a PollableChannel to be used within a poller:

@Bean
public PollableChannel pollableChannel() {
    return new QueueChannel(100);
}

@Bean
@ServiceActivator(poller = @Poller(taskExecutor="batchTaskExecutor"), 
                  inputChannel= "pollableChannel")
public MyHandler myHandler() {
    return new MyHandler();
}

Since adding this configuration, we are having an "asynch" span every second. It seems this span comes from the @Poller, checking whether there are items in the queue.

I'd like to know how to control this span. Is it possible to disable? Specially if there are no items.

Thanks in advance!

Upvotes: 0

Views: 1148

Answers (1)

Marcin Grzejszczak
Marcin Grzejszczak

Reputation: 11179

If it comes from the @Scheduled method then you can use https://github.com/spring-cloud/spring-cloud-sleuth/blob/master/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/scheduling/SleuthSchedulingProperties.java#L38 (spring.sleuth.scheduled.skipPattern) to find the thread and disable it. If you say its name is async then it means that it comes from a TraceRunnable or TraceCallable. That can be problematic to get rid off. You can file an issue in Sleuth to allow SpanAdjuster to actually not send spans to Zipkin (by for example returning null). You can also try to disable async at all spring.sleuth.async.enabled. If you're not using any other features of async that should not interfere.

Upvotes: 1

Related Questions