Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root Spans in Spring-Cloud-Gateway always named based on an "/" request #1535

Closed
Laures opened this issue Jan 24, 2020 · 3 comments
Closed
Labels

Comments

@Laures
Copy link

Laures commented Jan 24, 2020

Describe the bug
when integrating sleuth into spring-cloud-gateway every request creates two spans. the root span (created by httpclientbeanpostprocessor) is always a request aggainst "/". No matter what the actual request looks like. The second span is based on the actual request and created by TraceWebFilter

Sample
Create a basic project with spring-initializer containing spring-cloud-gateway, sleuth and a reporter/sender of your choice (i used both zipkin and google compute for testing). Configure a route and make a request.

spring:
  cloud:
    gateway:
      routes:
        - id: method_route
          uri: https://example.org/2
          predicates:
            - Path=/**

The exact trace content depends on your dependencies. Zipkin names the root span "GET". GCP names it "/". both a not usable.

@marcingrzejszczak
Copy link
Contributor

Which versions have you been using?

@Laures
Copy link
Author

Laures commented Jan 24, 2020

My sample project is based on spring-boot 2.2.4.RELEASE and spring-cloud Hoxton.SR1

that is spring-cloud-starter-sleuth and spring-cloud-starter-gateway 2.2.1.RELEASE

@marcingrzejszczak
Copy link
Contributor

In 3.0.0-SNAPSHOT and the upcoming milestone release we have done a lot of work in making the reactive approach work better with Spring Cloud Sleuth. Since Spring Cloud Gateway is fully reactive, with the following changes you'll be able to speed things up and get consistent results.

Example for the following setup:

spring:
  cloud:
    gateway:
      routes:
        - id: method_route
          uri: https://httpbin.org/
          predicates:
            - Path=/httpbin/**
          filters:
            - StripPrefix=1
  sleuth:
    reactor:
      instrumentation-type: manual

The trace with the root span clicked

image

The trace with the client span clicked
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants