spring-cloud-sleuth icon indicating copy to clipboard operation
spring-cloud-sleuth copied to clipboard

is it possible that sleuth generates a duplicate trace ids

Open hodeh opened this issue 9 years ago • 7 comments

I started to notice in Zipkin, that I have some of different requests sharing the same trace id, knowing that trace ids are generated with this format , 9e910dcf10ed8c69 . what can be the possible factors that led to multiple requests sharing the same id ?

hodeh avatar Jul 18 '17 08:07 hodeh

It shouldn't take place. Most likely it's a result of bug. Are you using Zuul? Might be related to https://github.com/spring-cloud/spring-cloud-sleuth/issues/634 maybe?

marcingrzejszczak avatar Jul 18 '17 08:07 marcingrzejszczak

@marcingrzejszczak yes I am :) what release train/spring boot version do you recommend me to use in applications that are using zuul ? in order for this not to happen?

hodeh avatar Jul 18 '17 08:07 hodeh

So this has just been fixed but not yet released. We will try to release it quite soon. Until then you'd have to use the snapshots :/ The fix will be available in Dalston, Edgware and Finchley (1.2.x, 1.3.x and 2.0.x versions of Sleuth)

marcingrzejszczak avatar Jul 18 '17 08:07 marcingrzejszczak

@marcingrzejszczak thanks a lot for ur feedback, question are u aware if this also effects previous versions of spring cloud like Camden.SR2, or previous versions of sleuth ?

hodeh avatar Jul 18 '17 14:07 hodeh

I'm pretty sure it does :/

marcingrzejszczak avatar Jul 18 '17 14:07 marcingrzejszczak

thanks , its fixed now so thats the more important thing. 😺

hodeh avatar Jul 18 '17 14:07 hodeh

private long createId() {
	return this.random.nextLong();
}

@Bean
@ConditionalOnMissingBean
public Random randomForSpanIds() {
	return new Random();
}

it seems that the problems are still happen,the source code is the same as previous version.only the random can not prevent duplicate trace ids

Jaware avatar Dec 21 '17 03:12 Jaware