Search code examples
jmxspring-cloud-sleuth

Start sleuth tracing at invocation of managed operation


I have a set of microservices but the call chain doesn't start with http. It starts with the invocation of a @ManagedOperation via JMX. The issue with this is that the invocation of this method doesn't start a trace.

Anyone know how to start the trace when a @ManagedOperation is invoked via JMX?


Solution

  • This can be accomplished by using @NewSpan on the @ManagedOperation method. I tried to use this previously but STS (spring tool suite) was having issues with the classpath so it wouldn't pull the import.