1

I have my setup with sleuth (spring-cloud-starter-sleuth) and zipkin (spring-cloud-sleuth-zipkin) which works perfectly fine. At the same time I would like to log to ELK duration of the requests. I was trying to get this information from currentSpan like

tracer.currentSpan().context()

but I don't see anything related to duration or start time. Any ideas how I can get duration or when current span (request) was started?

Bartek
  • 41
  • 2

1 Answers1

0

You can't do it from the span not the context. If you're using brave you can register your own SpanHandler beam that handles finished spans. There you have access to a MutableSpan that can give you the duration

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