2
votes

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.

1
That's the only workaround I have found. Would be good for spring boot actuator to implement this kind of functionality, since it seems to be no easy way to enable the tomcat manager in a spring boot app. - Xtreme Biker

1 Answers

0
votes

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