- Author(s): @g-easy
- Approver: vjpai
- Status: Draft
- Implemented in: C++
- Last updated: 2018-07-17
- Discussion at: https://groups.google.com/forum/#!topic/grpc-io/ZpXeFinzl5A
Add a public API for getting access to the OpenCensus Span for the current RPC.
The OpenCensus
filter
creates a Span per RPC, which can be accessed through the ServerContext
object.
Currently, the public API for the filter comes from:
#include <grpcpp/opencensus.h>
And GetSpanFromServerContext()
comes from:
#include "src/cpp/ext/filters/census/grpc_plugin.h"
L29 was the initial gRFC for OpenCensus integration.
PR15984 proposes moving
GetSpanFromServerContext()
into grpcpp/opencensus.h
Pros:
- Only one file needs to be
#include
d for OpenCensus tracing, instead of two.
Cons:
grpcpp/opencensus.h
has to depend onopencensus/trace/span.h
which, in turn, depends onabsl/strings/string_view.h
OpenCensus depends on Abseil, so at some point the consumer inevitably has to build it and link with it.
See PR15984.
N/A