0

I am trying to set up micrometer tracing with Jaeger. I am able to see spans and event flow from the rest API to the web service, but not able to see logs in Jaeger spans, such as info logs that can be used in debugging.

so the question is if we can see slf4j logs in Jaeger with Micrometer tracing. Is this feature supported in Micrometer and if so how is it done?

Soheil Babadi
  • 562
  • 2
  • 4
  • 15
Introvert
  • 76
  • 8

1 Answers1

-2

Micrometer itself does not provide direct integration with Jaeger for capturing SLF4J logs within the Jaeger spans.

However, you can achieve by combining Micrometer with other libraries such as the OpenTracing API and a compatible SLF4J binding. Here is some useful steps:

  1. Ensure that you already have Micrometer and Jaeger configured in your application.

  2. Add the OpenTracing API dependency to your project.

  3. Choose an SLF4J binding compatible with OpenTracing. For example, you can use the slf4j-simple implementation

  4. Configure the SLF4J binding of your choice according to its documentation. This configuration enables SLF4J logs to be captured by the binding implementation.

  5. In your application code, initialize an OpenTracing Tracer implementation compatible with Jaeger. For example, you can use the io.jaegertracing:jaeger-core library and its JaegerTracer class. Consult the Jaeger documentation or examples for details on how to configure and build the Tracer instance.

  6. Once you have a Tracer instance, create a Span using the OpenTracing API for each logical operation or section of code you want to trace. You can log SLF4J messages within these spans using the usual logging framework (e.g., LoggerFactory.getLogger(MyClass.class).info("Message")).

  7. With the OpenTracing API and SLF4J configured, Micrometer will automatically capture the necessary span information and send it to Jaeger. This includes any SLF4J logs made within the spans.

Soheil Babadi
  • 562
  • 2
  • 4
  • 15