title: Not able to trace a service from Jaeger UI using spring-boot application
body: <p>Unable to trace a services for springboot application on Jaeger UI(localhost:16686/search). Here I am able to run an application successfully, but unable to get a services in jaeger ui(Except defalut one jaeger-query). </p>
  
  <p>I used docker cmd to start the jaeger service,</p>
  
  <pre><code>docker run --rm -it --network=host jaegertracing/all-in-one
  </code></pre>
  
  <p>Open the Jaeger UI on <a href="http://localhost:16686/search" rel="nofollow noreferrer">http://localhost:16686/search</a></p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.web.client.RestTemplateBuilder;
  import org.springframework.context.annotation.Bean;
  import org.springframework.web.client.RestTemplate;
  
  import com.uber.jaeger.Configuration;
  import com.uber.jaeger.samplers.ProbabilisticSampler;
  
  @SpringBootApplication
  public class DemoOpentracing1Application {
  
  
  @Bean
  public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
      return restTemplateBuilder.build();
  }
  
  @Bean
  public io.opentracing.Tracer jaegerTracer() {
      return new Configuration("spring-boot", new Configuration.SamplerConfiguration(ProbabilisticSampler.TYPE, 1),
              new Configuration.ReporterConfiguration())
              .getTracer();
  }
  
  public static void main(String[] args) {
      SpringApplication.run(DemoOpentracing1Application.class, args);
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  import org.springframework.web.client.RestTemplate;
  
  @RestController
  public class HelloController {
  
  @Autowired
  private RestTemplate restTemplate;
  
  @RequestMapping("/hello")
  public String hello() {
      return "Hello from Spring Boot!";
  }
  
  @RequestMapping("/chaining")
  public String chaining() {
      ResponseEntity&lt;String&gt; response = restTemplate.getForEntity("http://localhost:8082/hello", String.class);
      return "Chaining + " + response.getBody();
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;2.2.6.RELEASE&lt;/version&gt;
      &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  &lt;groupId&gt;com.example&lt;/groupId&gt;
  &lt;artifactId&gt;demo_opentracing1&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;demo_opentracing1&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
  &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
                  &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;io.opentracing.contrib&lt;/groupId&gt;
          &lt;artifactId&gt;opentracing-spring-web-autoconfigure&lt;/artifactId&gt;
          &lt;version&gt;0.0.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.uber.jaeger&lt;/groupId&gt;
          &lt;artifactId&gt;jaeger-core&lt;/artifactId&gt;
          &lt;version&gt;0.18.0&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/8Pa0D.png" rel="nofollow noreferrer">Image 1</a>
  <a href="https://i.stack.imgur.com/hTFVj.png" rel="nofollow noreferrer">Image 2</a></p>
  
  <p>Github repository with demo: <a href="https://github.com/pavolloffay/opentracing-java-examples" rel="nofollow noreferrer">https://github.com/pavolloffay/opentracing-java-examples</a>.
  Please help me to solve this.</p>