You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is tribal knowledge that local (in-process) spans exist. We need a way to designate span as local, and offer insight into how to use them. This can lead us to answer what status quo could be on this, and how they might be tested.
Firstly, local spans need to be annotated with a namespace that can be used like service. A discussion on github suggests using a LOCAL_COMPONENT("lc") binary annotation for this.
You'll notice that the binary annotation holds almost all information needed to identify the context of the span. It contains a searchable annotation which contains its namespace, in this case encryption-service. Via the existing contract of binary annotations, it also includes the service that contains it, in this case proxy.
What's left is the skeleton of the span. How do we capture the duration of the span?
I'm aware of three options:
Re-use "cs/cr" annotations
Make up new annotations for the bookends of a local span.
If we re-use "cs/cr" annotations, we avoid logic around dependency graphs where server annotations are special-cased. In other words, we avoid accidentally cluttering it with local spans. We can also hang off an existing explanation where we use "cs/cr" to address uninstrumented systems. It might be the least code changes.
If we make up new annotations for the bookends, we avoid adding more cognitive weight to "cs/cr", which are already confusing. Instead, all two-character annotation keys prefixed 'l' explain local spans, and those not interested simply don't read their docs. We do have to add more constants, and affect the instrumentation more. While this is nice for documentation containment, it could look overwhelming.
If we piggy-back off Span.startTs/duration (#807), local spans really only need span metadata and the single binary annotation. This would result in less storage and cognitive burden, as we no longer need to think about annotations in order to understand the duration of a span. This is the most dramatic departure from existing "core annotations" so needs to be specifically supported in UI and presentation.
This moves existing code around the notion of Span.timestamp,
Span.duration discussed in #807.
The impact from a user POV is minimal. `endTs`, used by the query and UI
formerly looked for the last timestamp in a trace. What this meant is
that if someone clicked search, waited, then clicked search again with
the same `endTs`, an in-flight trace may "disappear" if it has new
activity. Since `endTs` is now based on a stable point (the start), a
trace wouldn't disappear anymore. This impact is so subtle that it is
barely worth discussing.
The primary motivation for this change is to simplify the commodity task
of timestamping and duration stamping spans. This is discussed #807, and
directly supports a new minimal design of local spans (#808).
Local spans have been discussed at length, but have never been
formalized. This formalizes how to tag a span as local, including
rationale documentation. To help demonstrate the point, zipkin-web and
zipkin-query use this for bootstrap tracing.
Fixes#808
Currently it is tribal knowledge that local (in-process) spans exist. We need a way to designate span as local, and offer insight into how to use them. This can lead us to answer what status quo could be on this, and how they might be tested.
Firstly, local spans need to be annotated with a namespace that can be used like service. A discussion on github suggests using a LOCAL_COMPONENT("lc") binary annotation for this.
Here's a json view:
You'll notice that the binary annotation holds almost all information needed to identify the context of the span. It contains a searchable annotation which contains its namespace, in this case
encryption-service
. Via the existing contract of binary annotations, it also includes the service that contains it, in this caseproxy
.What's left is the skeleton of the span. How do we capture the duration of the span?
I'm aware of three options:
TL;DR; is that I think the latter is best.
If we re-use "cs/cr" annotations, we avoid logic around dependency graphs where server annotations are special-cased. In other words, we avoid accidentally cluttering it with local spans. We can also hang off an existing explanation where we use "cs/cr" to address uninstrumented systems. It might be the least code changes.
If we make up new annotations for the bookends, we avoid adding more cognitive weight to "cs/cr", which are already confusing. Instead, all two-character annotation keys prefixed 'l' explain local spans, and those not interested simply don't read their docs. We do have to add more constants, and affect the instrumentation more. While this is nice for documentation containment, it could look overwhelming.
If we piggy-back off Span.startTs/duration (#807), local spans really only need span metadata and the single binary annotation. This would result in less storage and cognitive burden, as we no longer need to think about annotations in order to understand the duration of a span. This is the most dramatic departure from existing "core annotations" so needs to be specifically supported in UI and presentation.
The text was updated successfully, but these errors were encountered: