I'm working on a POC and was able to integrate 2 microservices with JaegerUI.
Request to an endpoint in serviceA calls an endpoint in serviceB and returns a response.
I have used below dependencies:
spring.boot.version : 2.1.4.RELEASE
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-web-starter</artifactId>
<version>3.1.1</version>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-cloud-starter</artifactId>
<version>0.4.0</version>
Spring autoconfiguration takes care of everything so just added the required properties:
opentracing.jaeger.http-sender.url
opentracing.jaeger.service-name
opentracing.jaeger.enabled
opentracing.spring.cloud.async.enabled
I want to achieve the below:
- I want to add application logs to the span so that they are visible in JaegerUI.
- I want to add some fields to span tags so that it's easy to search in JaegerUI.
- Also, I want the spanId and traceId to the application log.
- Is it possible to search in JaegerUI based on spanId/traceId? If yes, how?
Based on the answer in below SO question:
How to enrich Jaeger opentracing data with the application logs (produced by slf4j) for Spring Boot?
opentracing-spring-cloud-starter dependency should automatically take care of sending app logs to span in JaegerUI.
I have a log statement like below in serviceA:
logger.info("sending request to serviceB.");
But above log is not getting captured in corresponding span and not visible in JaegerUI.
Any suggestions on how to achieve the above scenarios are appreciated!