Search code examples
springspring-cloudzipkinspring-cloud-sleuth

Spring Cloud Sleuth + Zipking - How to trace individual instances


I am using Spring Cloud Sleuth + Zipkin to have an insight of the service timing and behaviour.

The only downside I have found is: when there are several instances of every microservice I haven't found a way to determine which instance Zipkin information is referring to, since it identifies them all by its service name (which is the same for all).

Is there a way to configure Sleuth to add service-instance dinstintion in Zipkin?


Solution

  • So you have an ip and port of your app so that could give you a hint. Also if you want a custom span of yours to have that information, then it's enough to add a custom tag to it. Actually you can always call the tracer.addTag("key", "value") to put the additional information that you need.