Logging to zipkin


#1

Hello, I had a similar issue as described in Zipkin not able to collect tracing info thread and therefore I started to use Zipkin’s http collector.

It works fine, but I assume that it is not a preffered way how to connect linkerd to zipkin (because you don’t ship the plugin with linkerd by default). Can you please provide me some more information about performance? Should I take some more time to try to establish communication with use of the scribe collector? We really need to focus on performance in our application… Thanks.

I have one more question. We would like to log more information to zipkin directly from our application (request to DB, etc.). Linkerd forwards l5d-reqid http header in order to correlate requests across services which we can use. Is it enough to correctly log new child requests to the same trace? I ask, because in trace detail from zipkin, I can see, that there is also a spanID element which is used to identify parent of the request:

{"traceID":"c6c35b668c62da1","spanID":"88108f594fe4d4dc","operationName":"post ...","references":[{"refType":"CHILD_OF","traceID":"c6c35b668c62da1","spanID":"3b4f0ffd082dfee0"}]}

But I cannot find the spanID in any http header… Do I need to enable the forwarding somehow?

Thank you.


#2

Hi @zsojma!

I believe that the zipkin http plugin is shipped in a separate repo for dependency/version management reasons, and not for performance reasons. If it’s working for you and meets your performance requirements then I don’t think there’s any need to worry.

The trace id is stored in the l5d-ctx-trace header. It’s base64 encoded and formatted as: spanId:8 parentId:8 traceId:8 flags:8' (big-endian). You can use this information when logging child spans to zipkin directly. You can see more details about the format here: https://github.com/twitter/finagle/blob/develop/finagle-core/src/main/scala/com/twitter/finagle/tracing/Id.scala#L140

Hope this helps.


#3

Thanks a lot @Alex .