Instead of servlet, the frontend is a Netty HTTP handler. The backend is Google gRPC 1.31. Both services run as a normal Java application.
- brave.example.Frontend - HTTP controller and Google gRPC client
- brave.example.Backend - Google gRPC server
- brave.example.TracingConfiguration - Configures trace instrumentation
This example also shows Brave's BaggagePropagation
. If you make a request to the frontend with
the HTTP header user_name
, it will transparently propagate and be readable even in gRPC.
Ex. The backend adds the user to the response, only if it can see a header that was sent to the frontend. This shows transparent propagation across different frameworks.
$ curl -s localhost:8081 -H"user_name: joey"
Sat Dec 19 16:11:01 MYT 2020 joey