I develop a Spring Boot app with version 1.2.4.RELEASE and want to measure some metrics data using Actuator. I'm getting some data at http://localhost:8080/metrics but I want rich data to be exposed there, like avg gauge times for my requests.
I found that a RichGauge class is contained in the Actuator plugin which does what I need but it doesn't seem to be used. I also couldn't find any information on google about how to achieve that.
Here is a snippet of my pom.xml with the spring dependencies:
<properties>
<spring.boot.version>1.2.4.RELEASE</spring.boot.version>
</properties>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>${spring.boot.version}</version>
</dependency>
How can I measure rich metrics data with the actuator plugin? Is there some configuration for that or do I need some code to achieve that?
I managed to get it running with the following code
Technically, the InMemoryRichGaugeRepository bean declaration alone should do the trick, but that implementation effectively disables the CounterService (replacing it with counts on anything reported to GaugeService) where only CounterService is used, so I found this workaround to get the old CounterService behaviour back.