I had setup Jaeger in Azure Kubernetes Cluster in monitoring namespace and I deployed my container which is instrumented with jaeger client libraries in monitoring domain. The service is up and running and I'm able to see the traces using actuator when I specify the :/actuator in the browser. But the same microservice is not populating in the service dropdown in Jaeger UI.
Below are the files i'm using.
DemoOpentracingApplication.java
@SpringBootApplication
public class DemoOpentracingApplication {
@Bean
public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
return restTemplateBuilder.build();
}
@Bean
public io.opentracing.Tracer jaegerTracer() {
return new Configuration("spribng-boot", new Configuration.SamplerConfiguration(ProbabilisticSampler.TYPE, 1),
new Configuration.ReporterConfiguration()).getTracer();
}
public static void main(String[] args) {
SpringApplication.run(DemoOpentracingApplication.class, args);
}
}
HelloController.java
@RestController
public class HelloController {
@Autowired
private RestTemplate restTemplate;
//private final Counter totalRequests= Counter.build().name("requests_total").help("Total Number of Requests").register();
@Timed(
value= "prometheus.hello.request",
histogram=true,
percentiles= {0.95,0.99},
extraTags= {"version","1.0"}
)
@RequestMapping("/hello")
public String hello() {
return ("Hello From OPenTracing Controller");
}
@Timed(
value= "prometheus.chain.request",
histogram=true,
percentiles= {0.95,0.99},
extraTags= {"version","1.0"}
)
@RequestMapping("/chaining")
public String chaining() {
ResponseEntity<String> response = restTemplate.getForEntity("http://localhost:8080/hello",String.class);
return "Chaining+" + response.getBody();
}
}
POM.xml
.....
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-web-autoconfigure</artifactId>
<version>0.0.4</version>
</dependency>
....
Why the instrumented service is not populating in Jaeger UI in Kubernetes?