0

After migrating on spring boot 3, I changed spring-sleuth to micrometer. After that change traceId or spanId are no longer generated in methods, which are managed by Quartz Jobs.

How to fix it?

cloud_7
  • 39
  • 1
  • 7

1 Answers1

0

Right now this is not implemented (@Scheduled is planned) but right now, as a workaround, you can add the @Observerved annotation (+create an ObservedAspect bean) on your methods that Quartz will call or create an Observation manually:

Jonatan Ivanov
  • 4,895
  • 2
  • 15
  • 30
  • Unfortunately the first solution does not work for quartz jobs. They are not managed by Aspect, so it's impossible to intercept it. – cloud_7 Jun 02 '23 at 14:38
  • You need to create a bean from the class that contain the method for runtime weaving but if you set-up compile-time weaving I can't really see how Quartz can avoid that. – Jonatan Ivanov Jun 02 '23 at 19:17
  • Ok, creating compile-time weaving is a bit complex. Quartz Job is not managed by spring, so Spring AOP does not intercept it automatically. I want the span context to wrap the whole job, not just beans that are used within that job. – cloud_7 Jun 05 '23 at 09:57