KREST-7091 POC of request tracing with focus on Produce v3 #1064
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a POC of a basic request tracing mechanism that intercepts requests, sets up a trace ID for each request, and traces (via logging) various stages of the request and response handling.
The POC uses Jersey filters for the main tracing pointcuts - it intercepts with a pre-matching request filter, post-matching request filter, and a response filter. The trace ID that can be extracted from the
ContainerRequestContext
can be used in the corresponding resources for further tracing (e.g. tracing just before making a Kafka RPC and just after receiving a result from it). The POC does that just for the Produce v3 API where it traces the parsing and sending of records, the reception of results (or errors), and the closing of the so-called produce batch or stream and the corresponding response channel.It has been tested with a Produce v3 workload of ~80 concurrent req/sec and seemed to work well, being able to provide various data points about E2E latency from the Kafka REST POV, Produce v3 request outliers, etc.