lightstep-tracer-javascript icon indicating copy to clipboard operation
lightstep-tracer-javascript copied to clipboard

Clock skew correction should take into account wrong window.performance time on browser platform

Open sbaum1994 opened this issue 5 years ago • 1 comments

In the nowMicros function for the browser platform implementation we try to use window.performance before falling back to Date.now() but these sometimes disagrees with window.performance.now() by significant amounts of time, causing incorrect traces if Date.now() or start times and end times are set in spans that are part of the same report.

sbaum1994 avatar Nov 20 '19 01:11 sbaum1994

Ideally, I think we should calculate the difference between performance.now() and Date.now() and then apply that as the clock correction offset on the spans.

sbaum1994 avatar Nov 20 '19 02:11 sbaum1994