-1

I need to know the SpandId in java code but I don't know how to get it. I had been searching and I found that many people refer to Tracer class, but it is not available at sleuth 2.0.4.

Does anybody know how to get the SpandId using sleuth 2.0.4?

Thanks!

1 Answers1

0

Just inject the brave.Tracer bean and then you can call tracer.currentSpan().context().spanId() or tracer.currentSpan().context().spanIdString()

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32