mirror of https://github.com/grpc/proposal.git
1.4 KiB
1.4 KiB
OpenCensus C++ Span API changes
- 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
Abstract
Add a public API for getting access to the OpenCensus Span for the current RPC.
Background
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"
Related Proposals:
L29 was the initial gRFC for OpenCensus integration.
Proposal
PR15984 proposes moving
GetSpanFromServerContext() into grpcpp/opencensus.h
Rationale
Pros:
- Only one file needs to be
#included for OpenCensus tracing, instead of two.
Cons:
grpcpp/opencensus.hhas to depend onopencensus/trace/span.hwhich, 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.
Implementation
See PR15984.
Open issues (if applicable)
N/A