Users can inject an identifier for each individual CQL request, and such ID can be written in to the custom payload to correlate a request across the driver and the Apache Cassandra server.
A request ID generator needs to generate both:
Usage:
RequestIdGenerator in advanced.request-id.generator.class.RequestIdGenerator is to add the request ID into the custom payload with the key request-id. Override RequestIdGenerator.getDecoratedStatement to customize the behavior.Request ID generator can be declared in the configuration as follows:
datastax-java-driver.advanced.request-id.generator {
class = com.example.app.MyGenerator
}
To register your own request ID generator, specify the name of the class that implements RequestIdGenerator.
The generated ID will be added to the log message of CqlRequestHandler, and propagated to other classes, e.g. the request trackers.