-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[WIP] Context propagation #297
Conversation
I'm -1 for sub packages for |
@@ -0,0 +1,68 @@ | |||
// Copyright 2019, OpenTelemetry Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO propagation.BinarySpanContext
reads better than binary.SpanContextPropagator
Think <topic>.<thing>
vs <namespace>.<what+topic>
. Example: http.Server
not server.HTTP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
propagation.BinarySpanContext
is a misleading name - it's a propagator, not a span context. The package names are kinda following the scheme from standard library as in encoding/json
or encoding/hex
, so we have propagation/binary
and propagation/http
.
// convert SpanContext to/from byte array. | ||
type SpanContextPropagator interface { | ||
Inject(core.SpanContext, Supplier) | ||
Extract(Supplier) core.SpanContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above signatures of Inject and Extract do not allow to have generic chainInjectors and chainExtractor described in the otep.
However, if these were to change, for example:
Extract(Supplier) context.Context
then the propagator has to extract the spanContext and save it in context.Context. Now we have two keys, one for spanContext and the other for Span. OR propagators have to start a span using the extracted spanContext which has its own issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only written chained propagators for specific stuff and they don't exactly match the behaviour from otep, since chained extractors are called until we get the valid span context, correlation or baggage. I'm not sure what's the use of the generic chainExtractor that calls all the extractors…
And about spancontext in the context - should the users of propagators get the span context from the extractor and pass it themselves to Tracer.Start
through some of the relationship-establishing option?
cea2722
to
cf717aa
Compare
What needs to happen to move this forward? |
This branch is sadly full of conflicts, particularly stemming from when we moved |
I plan to close this PR in a day or two after building a replacement that's closer to OTEP 66. Thanks @krnowak for the prototype. |
Closing this in favor of #381 which tracks the current state of OTEP66. |
* Add integration testing for unary client * Update to test both client and server unary interceptors * Add testing for streaming gRPC * lint * Update CHANGELOG * Update Changelog with PR number * Remove duplicate testing const
This is my initial proposal for context propagation, which more or less follows OTEP 42:
Map
withCorrelations
andBaggage
Correlations
only allows to add more stuff to itBaggage
gives the user more control of the stuff there.binary
andhttp
getHTTPInjector
orgetHTTPExtractor
for baggage or correlations. I didn't implement those - I think that basically picking an implementation of the propagator can be left to the library the wants to propagate stuff.