Allow Boost RPC API to capture parent trace contexts #771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables the ability for Opencensus or OpenTelemtry span contexts passed into Boost RPC client calls to be captured by Boost RPC server, nesting Boost RPC traces under the parent span passed to a given RPC method. Fixes #769.
filecoin-project/go-jsonrpc
already handles span contexts, but does so with Opencensus (OC) while boost is using Opentelemetry (OT). OC and OT trace spans are not compatible. However, OT has an OC API wrapper they call a bridge that allows us to use our OT tracer as the default OC tracer. This PR creates that bridge and sets up the default OC tracer to our OT tracer.Client Side
filecoin-project/go-jsonrpc/client.go
handles the given context and starts a new span from it calledapi.call
. It puts this span context into a property on the request calledMeta.SpanContext
.Server Side
filecoin-project/go-jsonrpc/handler.go
then looks forMeta.SpanContext
in the request object and decodes it into aSpanContext
, starting a new span with it.Additionally...
make build/all
, so I added it tomake build/all
andmake push/all
.