-
Notifications
You must be signed in to change notification settings - Fork 50
Extend span APIs to support callbacks and access to spancontext #247
Comments
Related to this, we also need to define the hooks and places where Tracestate can be modified. census-instrumentation/opencensus-java#1465? |
Also it will help with #131. Perhaps that can be closed as dup. |
Looping @falenn into the discussion. |
@reyang i'd like to be looped in as well |
I've started a document, describing use-cases and requirements: https://docs.google.com/document/d/1lu--sppvyFwcWUTnvDcxKFTm1ZtRWe4kwPZU_S86GoE/edit?usp=sharing Feel free to contribute and describe your use-cases there. |
Before I muddy the doc, I have a dilemma: Referring to #1465, a use case I would propose is the creation of new tracestate when acting as a client to propagate new vendoring information to downstream services. Here's my confusion: Is it inappropriate to propagate a system-id in a new tracestate? What is actually meant by vendoring and is it expected that the same vendoring information transit all requests / service exchanges for the life of the trace instance? |
Ok, to answer my own question, from https://w3c.github.io/trace-context/#tracestate-field, "The trace context is designed to allow extensibility for all distributed tracing systems. It requires them to respect context set by other systems." Vendoring, therefore is the translation of traceparent into other tracing wire / header protocols which are encapsulate in the tracestate. For example, W3C trace-context -> B3. or W3C-trace-context -> Jaeger. My conclusion, then is that the tracestate entries will always map to the traceparent, a.k.a the tracestate entries never contain any new information that is not already in the traceparent. If I wanted to pass system ids, then, this must still be done in metadata outside of W3C trace-context spec. Tracestate is not the place to add this. Also, if this statement is true, there is no need to directly mutate the tracestate at span building / Propagator extraction. Now I'm confused when trying to understand the utility of tracestate. When acting as a client and propagating a trace from a W3C-based wire protocol system to a B3 wire-protocol system, x-b3-headers have to be passed, not traceparent and tracestate. We can continue to pass traceparent and tracestate as headers, but there's no guarantee that the downstream system will record these as attributes into their analysis system, nor that they will share the trace data. If the downstream system was to share their trace data, couldn't they also add an exporter to export to our trace correlation system? When exactly is tracestate even used? Is the presence of tracestate compelling the downsteam's analysis system to share trace data with another analysis system? Ok, sorry - answered one question to then ask another. Can someone clarify for me the intended use of tracestate? If it should be mutable, I would write a use-case for tracestate decoration assuming its internal contents are useful only for systems that can interpret the wire protocol (perhaps I am thinking too much of Baggage). If tracestate is really for internal state and export, then its presence on the wire is not particularly useful. |
@falenn would you like to open this as a ticket in trace-context repo? If the Spec/documentation leaves you with uncertainty about To answer your question, |
One more comment, sorry. It probably sounds like I derailed this conversation! I have personally constructed a custom sampler that injects probability samplers based on discrete header information, per request. For each span created, a sampler is created after evaluating the request state. A callback after span construction for sampler injection would be useful. Also then, to follow my above comment, tracestate mutation may be required as my sampling decision is dynamic. I need to modify the TraceOptions, if not just to reflect accurate sampling decision. |
@yurishkuro Thank you with your explanation! I will open a ticket in trace-context. |
cc @erabug |
@yurishkuro Thanks again for working with me - just posted w3c/trace-context#263. I was confused as to the nature of tracestate, but now understand it to strictly echo traceparent with vendoring concerns. When I thought of tracestate more as baggage, I felt I needed to mutate it. |
This is to follow up on how to allow APM vendors to integrate with OpenCensus by having more access to span/spancontext.
opencensus-specs
.opencensus-specs
, we will merge the Python experimental branch into master, and start the implementation in other languages.The text was updated successfully, but these errors were encountered: