0

I've integrated sleuth into my application gateway and the services behind it. The traces in Stackdriver (GKE) look good but the root-span is always named "/". For example:

for example

The second span is also created by the gateway and has a much better name.

How can i configure sleuth in my gateway-service to use a different naming or fix whatever causes two spans?

EDIT1:

I created a minimal project with spring-gateway, sleuth and gcp and wrote a LoggingReporter to print all reported spans while having GCP auto-config working.

StackdriverHttpClientParser names spans based by the request uri. The second span is created by the TraceWebFilter based on a request with the full uri. the first span is created by the HttpClientBeanPostProcessor based on the uri "/".

I don't think this is a gcp issue. it is probably a problem with spring-gateway. Interestingly the TraceWebFilter span is created first, but the PostProcessor one is still the parent.

EDIT2: I created an issue in spring sleuth https://github.com/spring-cloud/spring-cloud-sleuth/issues/1535

Laures
  • 5,389
  • 11
  • 50
  • 76

1 Answers1

1

I'm agreed with comment made by Marcin, the problem could be on Stackdriver and you can validate this by running a trace in your environment (offline) and also by be assured that the x-cloud-trace-context: TRACE_ID/SPAN_ID is formatted correctly, as per what I have seen there are three ways to do it and are mentioned here.

If the trace results successful by running it offline without changing anything then the problem is with stackdriver.

Ariel Palacios
  • 317
  • 1
  • 6
  • i debuged into a sample project and added my findings. this does not seem to be a GCP specific problem. – Laures Jan 24 '20 at 11:41