-
Notifications
You must be signed in to change notification settings - Fork 76
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
Standardize format for "simple" baggages (a.k.a "tags") #13
Comments
Other open questions:
|
btw, I am obviously biased towards "baggage" because of OpenTracing, but I think "tags" is way too generic and ambiguous term, while "baggage" is unusual enough to not be confused with anything else. |
I do not understand why separation of concerns is not applied in OpenTracing, and I wonder why this pollution is proposed to infect the idea of a trace context spec. In my opinion the whole idea of baggage transport is seriously flawed, and I seriously had hoped that this spec will be the remedy, reducing it to the minimal need of understanding a trace and being able to continue it. If you want a tldr of why I dislike baggage or tags, then here is the focal point: |
Instrumentation for tracing consists of 90% of general purpose distributed context propagation, and 10% of the actual tracing. There are initiatives to separate DCP into its own layer (e.g. https://github.com/tracingplane). We discussed it at the inception of OpenTracing (which actually started as "Distributed Context Propagation" project), but decided that we want the API to be easy for tracing first, and simply expose the DCP (baggage) API which would have to be implemented anyway, since tracing cannot exist without DCP. I think the same reasoning applies here. It's certainly possible to limit the scope of this spec to only the tracing piece, except that there have been already many questions "what about this" which can be easily solved with general-purpose baggage spec. It is not clear from your comment if you think the notion of general purpose DCP itself flawed, or any specific implementations of it. If it's the former, then I can say this:
Yes, that is the main feature of baggage. Actually, they do have semantics for components that care about specific items. And components that don't care don't need to know the semantics, they only need to pass the data along to the next layer. If every baggage item had semantics that every one of 5000 microservices understood, we'd need to change all 5000 microservices if we want to add one more baggage item, even if only 1% of them actually care about interpreting it. |
Added another open question to my #13 (comment) above regarding name spacing of baggage keys. |
just like RFCs (we we aren't even at the stage of) change a bunch of times, we can expect whatever we do here to change. I would like to follow-up with @CodingFabian to figure out what we can do around this. For experimentation sake, the bikeshedding the name a bit, I think |
Truly just throwing this out there in the spirit of sharing ideas (translation: I'm not sure I like what I'm about to propose, either)... Another way to look at this is that there's one set of trace context fields that are for tracer-internal purposes, and potentially another set of trace context fields for tracing-user purposes. The "internal" fields are basically what's been discussed elsewhere in this repo: trace-ids, span-ids, and sampling bits. The "user" fields would be things like census-style accounting entities, security tokens, and so on. The latter maps almost 1:1 with the opentracing "baggage" concept, of course, though this is a different way of framing it. Separating the "user" fields from the "internal" fields seems safer from an interference and isolation standpoint. I wonder (and this is the most questionable part here) if we could use precisely the same format or meta-format for the "user" and "internal" fields – could be an elegant unification. (Though I suspect it won't be compact enough for the tracer-internal state) |
@bhs While I like the idea of avoiding potential naming collisions between trace internals and user space, if this gets popular and becomes more standardized, I also see a potential for a third grouping of collisions from frameworks/libraries. That may be something to consider when trying to decide to split or not. |
@tylerbenson that's a great point. I still like the idea of segmenting state that's specific to tracer internals... wouldn't want it to get lost or truncated because of overzealous user behavior. |
@bogdandrutu Since we have Maybe you will say, baggages are somthing of application data, |
hi everybody, I'd like to add our point of view at Dynatrace to this discussion, if I may. :-) So I absolutely vote for something like the baggage concept to propagate tool-internal information - which mostly consists of various IDs for us. As the majority of this thread seems to do, I also suggest to separate the headers between "general tracing data" and "internal tracing data" (= baggage). So from my point of view the basic behavior guidelines should be:
I also don't see the need to specify the exact encoding, but general tracecontext rules could be recommended: e.g. use '-' as separator, base16 encoding of numeric values
and a specific tool's bagagge could look like this (but it's actually up to the tool)
Of course there should be no tool name collision, but I guess that should be doable. :-) For a binary representation there should of course also be size information included, which I don't see necessary for the HTTP header representation. Having said all that an actual bagagge HTTP header could IMHO simply look like this:
@yurishkuro sorry for the Uber sample, that was the first name that came to my mind ;-) |
So from my point of view the basic behavior guidelines should be:
if there is bagagge coming in, it has to be passed along
tools may modify their own bagagge, but must not touch bagagge from other tools
baggage may be dropped, but only if really really necessary
What you are describing is very much like actual Baggage, except
simplified quite a bit with text-header encoding. Main points are we
are firewalling contexts between tools as demonstrated here
https://github.com/JonathanMace/tracingplane-opentracing/tree/master/src/main/baggage
cc @JonathanMace
|
Another question to add: Suppose I have some async components, or suppose I propagate my baggage in RPC responses. How do I combine a key that has two different values for a tag? FWIW here's the paper we wrote about baggage: http://cs.brown.edu/people/jcmace/papers/mace2017layered.pdf The paper's a bit roundabout in its message, but is certainly a good resource for this discussion (feel free to contact me to discuss it, especially if you disagree with any of our assertions) Also not-quite-as-relevant, here's the upcoming SOSP paper on Canopy, Facebook's e2e tracing system: If code matters more than words, I've begun implementing our baggage stuff for other languages (e.g., https://github.com/tracingplane/tracingplane-go/blob/master/atomlayer/api.go is our minimal implementation of TP propagation in Go, at 118 LOC) and instrumenting other platforms (e.g., shamelessly butchering https://github.com/JonathanMace/spring-cloud-sleuth). I'll use the sock shop demo (https://microservices-demo.github.io/) to illustrate some baggage concepts. Also we hacked a goroutine-local context into go (https://github.com/JonathanMace/tracing-framework-go/blob/master/cmd/modify-runtime/modify.go) which is cool. |
I believe this issue is addressed by introduction of |
Background:
Open Questions:
The text was updated successfully, but these errors were encountered: