tryfer / node-tryfer

A Node Zipkin Tracer Library.
Apache License 2.0
45 stars 27 forks source link

Examples are wrong #14

Closed wadey closed 10 years ago

wadey commented 10 years ago

The examples say that .clientRecv should be called immediately:

But if that is done, all annotations after it are lost. The endpoint code sends the trace immediately when .clientRecv is called:

It looks like any annotations that happen after get stuck in limbo forever if this happens. Is this a bug in EndAnnotationTracer, or is it a bug to try to add annotations after .clientRecv?

cyli commented 10 years ago

You are absolutely correct, thank you! The bug is in the example is that it tries to add annotations after .clientRecv, and it shouldn't. I've made the following PR to address this issue: https://github.com/racker/node-tryfer/pull/15. Would you mind having a look?