How to get Cassandra driver metrics with AbstractCassandraConfiguration?
04:41 17 Feb 2026

I'm trying to get driver metrics for Apache Cassandra via Prometheus from my Spring Boot 4 application which uses Spring Data Cassandra. The Cassandra config is done via an extension of AbstractCassandraConfiguration in a class called CassandraConfig. This has worked since Spring Boot 2.

The documentation for Spring Data Cassandra on Observability suggests to add code for an OservableCqlSessionFactoryBean; but when I add that Spring Boot complains that there are multiple CqlSessions defined (one through my CassandraConfig and one through the ObservabilityConfiguration).

When I make the one in ObservabilityConfiguration the primary the cassandra config through the CassandraConfig isn't used any more so there's basically no working cassandra config.

Is there a way get Cassandra observability and configure Cassandra via an AbstractCassandraConfiguration?

spring-boot cassandra metrics spring-data-cassandra observability