Motivation:
The DataStax Java driver for Cassandra can be configured to expose driver session operational metrics. Currently these metrics are not available through Spring Boot Actuator.
Modifications:
This commit adds support for Cassandra driver metrics through Spring Boot Actuator by enabling the Cassandra driver's Micrometer metrics module.
Result:
Users are now able to access Cassandra driver enabled metrics through Actuator.
NOTE: This PR uses the Cassandra driver's native Micrometer metrics as opposed to the previous approach here.
Comment From: snicoll
@emerkle826 how is it going? Do you have an update for this change? Thanks!
Comment From: emerkle826
@snicoll I should have an update to this PR in a day or 2. I was waiting for the 4.9.0 release of the DataStax driver, which now has the ability to bind in the metrics with a Customizer.
Comment From: emerkle826
@snicoll @shakuzen I've updated the PR to use the latest 4.9.0 driver, which allows for a simple Customizer bean to enable metrics on the session. I've also added a driver config Customizer bean to siwtch driver metrics from Dropwizard to Micrometer and enable all of the driver metrics.
Comment From: snicoll
I should also mention that I've started to polish the proposal already so there is no need to push additional commits. I'd like some feedback on what API I should be using so that users can override those settings if they want to.
Comment From: snicoll
@emerkle826 @adutra any feedback on the review for me? In particular, not being able to see if the user has configured something is very annoying so I could use your insights. Thank you!
Comment From: snicoll
@emerkle826 @adutra how is it going? Sorry for the ping again but if we want this feature to land in 2.4 we really need to find a solution for the problem described in the review. Can I help?
Comment From: snicoll
@adutra thanks for the feedback. I've moved this issue out of the 2.4.x
milestone accordingly. I think what we really miss is a way for us to know that the driver was already configured with regards to metrics so that we can back-off (the overriding part is not necessary as we can document that users have to order their customisers before ours if they want to take control over the configuration).
Comment From: snicoll
@emerkle826 @adutra any feedback for this issue? An alternative would be to close this issue and another proposal can be submitted once the underlying infrastructure is available.
Comment From: adutra
Hi, sorry for taking so long to chime in.
First of all, driver 4.10 was released last week, and would really recommend that Spring Boot upgrades to that version.
With 4.10 out, I would recommend switching from ProgrammaticDriverConfigLoaderBuilder
to the new OptionsMap
API. But that would require a separate PR since the scope is wider.
Once this is done, I think we could finish the work here (I say "think" because I didn't quite understand the concrete implications of the reservations expressed here).
All in all, I would say that it's probably wiser to close this PR and we'll get back to it when possible.
Comment From: snicoll
Alright, let's close it now. Let me know when you want to give this one another go.
As for the reservation, if we auto-configure something, the user should have a way to be able to override this one way or the other. As long as this is possible, there is no problem but what I've experienced so far didn't let me do this (there are some details in this very issue).