1
votes

I am trying my first project with Spring Cloud Starter Sleuth on SpringBoot2 and am running into an issue. Let me share my app's configuration first:

POM.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>
    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <spring-cloud.version>Finchley.RC2</spring-cloud.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-sleuth</artifactId>
    </dependency>
        <build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<repositories>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
...

Application.yml

spring:
  application:
    name: MyApp
logging:
  level:
    org:
      springframework:
        cloud:
          sleuth: DEBUG

I start my application but I dont see any spanIds or Trace ids on hitting my services.

This is how the log looks:

...
2018-05-29 15:06:39.727  INFO [MyApp,,,] 13916 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 22 ms
2018-05-29 15:06:39.727  INFO [MyApp,,,] 13916 ---

What am I doing wrong here in my app configuration?

1

1 Answers

2
votes

Why do you think that anything is wrong? Have you logged anything after getting a request? I think we write about this in the Readme of the project that if you just start the app nothing will happen. try logging sth in the controller and send a request to see ids in the logs