I have a question regarding tracing. We have an application with Spring Boot and the latest version of Axon. We want to add tracing to this application. So far, we’ve added Spring Cloud Sleuth with the Zipkin protocol to send traces to Jaeger. At this point we want to add Axon tracing as well.
How can we best hook this up? I noticed that OpenTelemetry got added in the 4.6.0 release. Is it possible to integrate all this (Spring REST call + Axon command/event handling) in a single trace end-to-end? If so, how can I set this up. I went through the docs, but I didn’t find the necessary info for this.
Since OpenTelemetry has support for Spring out of the box, I would suggest removing all tracing configuration you have now and switching over to OpenTelemetry fully.
You will need to run its java agent, along with configuration where to send the tracing (often using environment variables). You can read more about how to set this up on the OpenTelemetry documentation.
For example, I am running my local application like this:
All Spring calls are instrumented automatically and sent to Jaeger. Note that Jaeger supports the OTLP format, but you need to switch this on manually (COLLECTOR_OTLP_ENABLED=true).
You can also run a collector that switches the format, I believe, but I have never tried this out for myself.