jetty-runtime
jetty-runtime copied to clipboard
Track the Jetty request span in Cloud Trace
The span of the request while being processed by Jetty should be reported to Cloud Trace by adding a span to the trace ID found in the x-cloud-trace-context HTTP header.
It should be possible to optionally enable/disable this feature.
Perhaps use Open Census for this in order to enable tracing for gRPC calls as well: https://github.com/census-instrumentation/opencensus-java/tree/master/exporters/trace_stackdriver#quickstart
Note that for other reasons we are working on adding a new listener to the next jetty 9.4 release that will make it much simpler to track all phases of a request/response life cycle - request line, headers complete, body complete, commit response, response complete.
Thanks for the heads of up Greg! It sounds like it would be good place to plug in our tracing.
Note that HttpChannel.Listeners were added in 9.4.8, which should be ideal for this task.