-
Notifications
You must be signed in to change notification settings - Fork 38
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
Don't report span.timestamp or duration when you didn't create the span #91
Comments
ps mostly unrelated, but in some other implementations, when we start a span, we log a tick (or otherwise start a timer). When this is set (ex it wouldn't be set if it were a continued server span), we extract a measurement in microseconds as duration. Using this is more reliable than system time, as it never risks moving backwards during a span (ex from NTP adjustments). Not sure best mechanism in ruby, but I've found http://ruby-doc.org/stdlib-2.3.3/libdoc/benchmark/rdoc/Benchmark.html and https://github.com/copiousfreetime/hitimes |
I think the third one would not pass and require several changes. |
The third is weird, "tha lack of this optional sampled header in fact
means you own this", weird. Current code will not like this
well, if you think about it, it makes sense. You'd never propagate
sampled=1 unless you started the span.
lack of a sampled header means "defer sampling decision downstream" which
means it hasn't been sampled or reported yet.
anyway, we can leave out part 3 for now, just it will eventually come up.
when it does, this is how it would be handled.
|
in other words the sampled header is indeed required for any span that
the caller reports to zipkin. I can fix the b3 docs as it seems
unclear.
|
actually it is already there..
https://github.com/openzipkin/b3-propagation#details
|
Zipkin's RPC span is interesting because it is a shared model. For example, a client creates a span and then the next hop (a server) adds annotations to it. The authoritative owner of the span is the one that's supposed to set timestamp and duration. In the case where it is originated by a client, the client, not the server, should set timestamp and duration.
See openzipkin/openzipkin.github.io#49
Why bother?
If we special-case timestamp and duration reporting, a couple things happen:
Do we need to do anything?
I'm not sure if the current implementation is doing this fine or not, but it is probably useful to add tests to make sure it it. Usually, there's very little to do to special-case this, and it always is where B3 headers are read.
Here are tests that should smoke it out
client creates a span and propagates it to a server
server creates a new trace
server creates a new trace with externally supplied ids
Does this make sense? Can anyone help translate this into tests for us?
See openzipkin/brave#277 (comment)
The text was updated successfully, but these errors were encountered: