The MicroProfile Metrics specification provides us with a unified way of exporting your services' monitored data to management agents. This helps us perform proactive checks on some key statistics indicators, such as the number of times and the rate at which a service has been requested, the duration of each request, and so on.
Let's get coding. Here, we will focus on the Chapter06/metrics example. First off, in order to use the metrics extension, we have included the following dependency in the pom.xml file:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>io.quarkus:quarkus-smallrye-metrics</artifactId>
</dependency>
Now, we'll provide an overview of the metrics annotations that have been added on top of our REST service. Let's start with the @Counted annotation, which tracks...