appmetrics-zipkin
appmetrics-zipkin copied to clipboard
Can we get the traceId to use for logging?
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.
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
@sri420 In request headers. There is a property named X-B3-TraceId, you can find traceId from there.