opentelemetry-java/examples/grpc
John Watson d92844a5b6
Update READMEs to be more helpful (#3007)
* Update READMEs to be more helpful

* update the main title

* upper case for Jason

* lower case link titles

* typo fix
2021-03-10 19:51:28 -08:00
..
src/main update the example code for the 0.17.0 release. (#2886) 2021-02-18 15:01:44 -08:00
README.md Update READMEs to be more helpful (#3007) 2021-03-10 19:51:28 -08:00
build.gradle Update readme and examples for 1.0.0 (#2949) 2021-02-26 14:18:16 -08:00

README.md

gRPC Example

Note: This is an advanced scenario useful for people that want to manually instrument their own code.

This example demonstrates how to use the OpenTelemetry API to instrument normal and streamed gRPC calls. The example creates the Root Span on the client and sends the distributed context over the gRPC request. On the server side, the example shows how to extract the context and create a Child Span.

How to run

Prerequisites

  • Java 1.8

1 - Compile

../gradlew shadowJar

2 - Start the Server

java -cp ./build/libs/opentelemetry-examples-grpc-0.1.0-SNAPSHOT-all.jar io.opentelemetry.example.grpc.HelloWorldServer

3 - Start the normal Client

java -cp ./build/libs/opentelemetry-examples-grpc-0.1.0-SNAPSHOT-all.jar io.opentelemetry.example.grpc.HelloWorldClient

4 - Start the streamed Client

java -cp ./build/libs/opentelemetry-examples-grpc-all-0.1.0-SNAPSHOT.jar io.opentelemetry.example.grpc.HelloWorldClientStream