spring-bootspring-sessionspring-data-redisspring-boot-actuator

Getting Spring Session information from Spring Actuator


I have a spring cloud based application that stores the spring session in redis. It is using Spring Boot with embedded tomcat.

When using spring actuator, the /metrics endpoint does not return any valuable information. httpsessions.active is set to 0, and httpsessions.max is set to -1.

I am guessing this is because spring replaces the httpsession implementation with its own spring session implementation.

Is there a way to access this information from some endpoint? preferably using JMX but not mandatory.

Thanks.


Solution

  • I eventually used the following solution, by using a generic username. The endpoint would return all sessions, a simple count would give the total.

    http://docs.spring.io/spring-session/docs/current/reference/html5/guides/findbyusername.html