aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp/opencensus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpcpp/opencensus.h')
-rw-r--r--include/grpcpp/opencensus.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/grpcpp/opencensus.h b/include/grpcpp/opencensus.h
index 7e5d1dfeb4..07a1333986 100644
--- a/include/grpcpp/opencensus.h
+++ b/include/grpcpp/opencensus.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