-
Notifications
You must be signed in to change notification settings - Fork 131
Conversation
|
OpenTracing does not dictate the resolution of timer used by the tracer internally, but it does specify the format of the timestamps passed into methods like Also, the meaning of the explicitly passed timestamps is always milliseconds since epoch (higher precision can be provided via fractional decimal values). The Jaeger's internal representation is always microseconds since epoch. Given the above, your current implementation is incorrect, because hrtime() does not return anything "since epoch", but since an arbitrary time point. It does not mean we cannot use it, but it needs to be used with care. I suggest checking jaeger-client-java implementation on how that was done. Lastly, I think switching to hire-res timer should only happen on user request (when constructing the tracer), not by default. |
I looked at the java implementation and I understand what you are saying. I will change my implementation to match the specs. Thanks for your input. |
Please note there was an issue opened recently in the Java client repo that shows that even Java implementation is flawed. |
This jaegertracing/jaeger-client-java#192 issue yes? What you say in the comment about "startTime" and "nano second offsets from arbitrary time" is true for javascript implementation too. So I will run into the same problem...I will look more but do you have any suggestions on how to deal with it? |
Let's discuss on jaegertracing/jaeger-client-java#192, if we find the solution there I assume it will apply to Node.js as well |
@sul4bh we decided to go with: Store the wall clock at the start of a process in the SpanContext. Pass it to child spans. Use nanoTime + offset to calculate start_time and duration. This will ensure that inside a single trace within a single process the start times are accurate with nanosecond precision. Are you still available to work on this? |
Yes, I am available. |
NB: this PR has a lot of odd formatting changes that actually go against our common coding style. Let's keep it to functional changes only. |
From what I understand, this is what we are doing?
Basically, calculate startTime and duration for Spans using wallClock from SpanContext and nano-time offset? |
Yes, with an additional assumption that every time a new SpanContext is created from an existing context it inherits wallClock + nano |
I haven't been following the developments. I will close this. |
This PR addresses #31
This is not ready for a merging yet. I want to discuss few thing with you guys:
Running
npm run flow
gives me the following error. Any idea how to fix it?