Merge pull request #15984 from g-easy/hdrs

Move GetSpanFromServerContext() to public header.
pull/16408/head
Vijay Pai 6 years ago committed by GitHub
commit ccc6ee3db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      include/grpcpp/opencensus.h
  2. 4
      src/cpp/ext/filters/census/grpc_plugin.h

@ -19,6 +19,12 @@
#ifndef GRPCPP_OPENCENSUS_H
#define GRPCPP_OPENCENSUS_H
#ifndef GRPC_BAZEL_BUILD
#error OpenCensus for gRPC is only supported when building with bazel.
#endif
#include "opencensus/trace/span.h"
namespace grpc {
// These symbols in this file will not be included in the binary unless
// grpc_opencensus_plugin build target was added as a dependency. At the moment
@ -36,6 +42,11 @@ void RegisterOpenCensusPlugin();
// ViewDescriptors below.
void RegisterOpenCensusViewsForExport();
class ServerContext;
// Returns the tracing Span for the current RPC.
::opencensus::trace::Span GetSpanFromServerContext(ServerContext* context);
} // namespace grpc
#endif // GRPCPP_OPENCENSUS_H

@ -24,15 +24,11 @@
#include "absl/strings/string_view.h"
#include "include/grpcpp/opencensus.h"
#include "opencensus/stats/stats.h"
#include "opencensus/trace/span.h"
namespace grpc {
class ServerContext;
// Returns the tracing Span for the current RPC.
::opencensus::trace::Span GetSpanFromServerContext(ServerContext* context);
// The tag keys set when recording RPC stats.
::opencensus::stats::TagKey ClientMethodTagKey();
::opencensus::stats::TagKey ClientStatusTagKey();

Loading…
Cancel
Save