summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md')
-rw-r--r--src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md b/src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md
new file mode 100644
index 000000000..96d1dc279
--- /dev/null
+++ b/src/jaegertracing/opentelemetry-cpp/examples/grpc/README.md
@@ -0,0 +1,107 @@
+# OpenTelemetry C++ Example
+
+## gRPC
+
+This is a simple example that demonstrates tracing a gRPC request from client to
+server. There is an experimental directory in this example - the code within has
+been commented out to prevent any conflicts. The example shows several aspects
+of tracing such as:
+
+* Using the `TracerProvider`
+* Implementing the TextMapCarrier
+* Context injection/extraction
+* Span Attributes
+* Span Semantic Conventions
+* Using the ostream exporter
+* Nested spans
+* W3c Trace Context Propagation (Very soon!)
+
+### Running the example
+
+1. The example uses gRPC C++ as well as Google's protocol buffers. Make sure you
+ have installed both of these packages on your system, in such a way that
+ CMake would know how to find them with this command:
+
+ ``find_package(gRPC)``
+
+2. Build and Deploy the opentelementry-cpp as described in
+ [INSTALL.md](../../INSTALL.md). Building the project will build all of the
+ examples and create new folders containing their executables within the
+ 'build' directory NOT the 'examples' directory.
+
+3. Start the server from your `build/examples/grpc` directory. Both the server
+ and client are configured to use 8800 as the default port, but if you would
+ like to use another port, you can specify that as an argument.
+
+ ```console
+ $ ./server [port_num]
+ Server listening on port: 0.0.0.0:8800
+ ```
+
+4. In a separate terminal window, run the client to make a single request:
+
+ ```console
+ $ ./client [port_num]
+ ...
+ ```
+
+5. You should see console exporter output for both the client and server
+ sessions.
+ * Client console
+
+ ```console
+ {
+ name : GreeterClient/Greet
+ trace_id : f5d16f8399be0d2c6b39d992634ffdbb
+ span_id : 9c79a2dd744d7d2d
+ tracestate :
+ parent_span_id: 0000000000000000
+ start : 1622603339918985700
+ duration : 4960500
+ description :
+ span kind : Client
+ status : Ok
+ attributes :
+ rpc.grpc.status_code: 0
+ net.peer.port: 8080
+ net.peer.ip: 0.0.0.0
+ rpc.method: Greet
+ rpc.service: grpc-example.GreetService
+ rpc.system: grpc
+ events :
+ }
+ ```
+
+ * Server console
+
+ ```console
+ {
+ name : GreeterService/Greet
+ trace_id : f5d16f8399be0d2c6b39d992634ffdbb
+ span_id : 1e8a7d2d46e08573
+ tracestate :
+ parent_span_id: 9c79a2dd744d7d2d
+ start : 1622603339923163800
+ duration : 76400
+ description :
+ span kind : Server
+ status : Ok
+ attributes :
+ rpc.grpc.status_code: 0
+ rpc.method: Greet
+ rpc.service: GreeterService
+ rpc.system: grpc
+ events :
+ {
+ name : Processing client attributes
+ timestamp : 1622603339923180800
+ attributes :
+ }
+ {
+ name : Response sent to client
+ timestamp : 1622603339923233700
+ attributes :
+ }
+ links :
+ }
+ ```