appmetrics-zipkin icon indicating copy to clipboard operation
appmetrics-zipkin copied to clipboard

Can we get the traceId to use for logging?

Open sri420 opened this issue 7 years ago • 2 comments

Is there a way to get the traceId which is propagated to Zipkin.

I want to log the traceId in log file during my logging so as to search the logs later.

sri420 avatar Feb 13 '18 09:02 sri420

If you're using Koa, for example, what I would do is add a middleware that takes the X-B3-TraceId from the original incoming request, and assign it onto the context, so the rest of the flow can use that as comfortably.

Take a look at the example here

Eli-Goldberg avatar Jul 10 '18 12:07 Eli-Goldberg

@sri420 In request headers. There is a property named X-B3-TraceId, you can find traceId from there.

xiaoxi625 avatar Aug 22 '18 01:08 xiaoxi625