0

We're switching from Ribbon to Spring Cloud Load Balancer, and thus far things seem to work. However I want to be able to see which instance is chosen on each request to verify the behavior.

Is there a debug flag or some other way to see which instance SCLB is choosing on each request?

1 Answers1

0

The selected service instances are logged for debug in various places on the client side, for example in ReactorLoadBalancerExchangeFilterFunction, in RetryLoadBalancerInterceptor, in RetryableLoadBalancerExchangeFilterFunction, etc. Also,for WebClient-backed load-balancing you can enable setting instance Id as a cookie. You can also enable Micrometer support, which will register various useful metrics, including instance ids. Additionally, you can implement your own logging mechanism using the LoadBalancerLifecycle callbacks.

OlgaMaciaszek
  • 3,662
  • 1
  • 28
  • 32