Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.39 KB

L34-cpp-opencensus-span-api.md

File metadata and controls

59 lines (41 loc) · 1.39 KB

OpenCensus C++ Span API changes

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.h has to depend on opencensus/trace/span.h which, in turn, depends on absl/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