-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clock skew adjuster and spans from web/mobile #722
Comments
There may be a bug in the clock skew adjustment algorithm. While it does center child span if the parent span's timing is way off, it's not supposed to center everything, i.e. if most server side spans have reasonable relative timestamps their relative positions should be sensible. It would be helpful if you could post a JSON of the trace that gets centered incorrectly. Unfortunately, we don't have an obfuscation utility, so if you obfuscate manually please make sure to keep the process tags consistent. And you can strip all tags and logs aside from span.kind tags. |
Here it is: https://gist.github.com/mabn/ec35eb5d6f4a9789b46fd1373c601352
|
The issue is in {
description: "root starts after all descendants",
trace: []spanProto{
{id: 1, parent: 0, startTime: 10, duration: 100, host: "a", adjusted: 10},
// latency = (100-50) / 2 = 25
// delta = (10 - 0) + latency = 35
{id: 2, parent: 1, startTime: 0, duration: 50, host: "b", adjusted: 35,
logs: []int{5, 10}, adjustedLogs: []int{40, 45}},
// child fits inside parent - no additional adjustment
// adjusted = startTime + parentSkew (35) = 45 - but current logic makes it 55
{id: 3, parent: 2, startTime: 10, duration: 10, host: "c", adjusted: 45},
},
}, Initially span 3 fits under its parent - span 2 starts at 0, span 3 starts later at 10. Adjustment starts:
I'm not entirely sure what is the expected behaviour.
|
This is something Otel is dealing with currently (relevant discussion here open-telemetry/oteps#154) There are similar discussions in the OpenTelemetry js repo as well since it's a bigger issue coming from the web side. Since there is no standard to handle this type of skew, and it would normally be defined in the instrumentation, Jaeger is merely the visualizer. |
Spans captured on the web/mobile do not have accurate start times as those devices are not synchronized with the server clocks.
Because of this I use timestamp of the moment they are received by the backend.
It's still wrong because:
The problem is that clock-adjusted "centers" everything if the web span is too much off:

This is how it looks if the web span is not reported as a root. The positions more or less reflect reality:

Am I doing something wrong?
How to approach reporting mobile/web spans?
Does clock skew adjusted need some changes to support web/mobile spans?
I'm using version 1.2.0
The text was updated successfully, but these errors were encountered: