Hi!
I can configure the default RequestLogger like this
datastax-java-driver { advanced.request-tracker { class = RequestLogger
It works great but I'm also using another RequestTracker in my application and I can't find a way to have both.
I know that internally there is a MultiplexingRequestTracker to which serveral RequestTrackers can be .registered(). It seems to be created really late though, after Springs CqlSessionBuilderCustomizer for instance. If I add a RequestTracker there the configured one will not be created.
Is there any customizer I can use that would give me the MultiplexingRequestTracker to append RequestTrackers to?
If not, can I create my own MultiplexingRequestTracker and add both the RequestLogger and my own RequestTracker to it? How would I get ahold of the DriverContext needed?
It feels like I'm getting to close to the core for comfort ;)
EDIT, added example:
The BoundStatementProfile inherits from RequestTracker
@Bean @ConditionalOnClass(MeterRegistry.class) public CqlSessionBuilderCustomizer requstTrackerCustomizer(MeterRegistry meterRegistry) { return cqlSessionBuilder -> { // Create a MultiplexingRequestTracker to be able to add both logging and the BoundStatementProfiler // This, and how the RequestLogger is created, mimics // com.datastax.oss.driver.internal.core.context.DefaultDriverContext.buildRequestTracker MultiplexingRequestTracker multiplexingRequestTracker = new MultiplexingRequestTracker(); // TODO: Get the DriverContext // RequestLogger requestLogger = new RequestLogger(driverContext); // multiplexingRequestTracker.register(requestLogger); BoundStatementProfiler boundStatementProfiler = new BoundStatementProfiler(meterRegistry); multiplexingRequestTracker.register(boundStatementProfiler); cqlSessionBuilder.withRequestTracker(multiplexingRequestTracker); }; }