Creating your own metrics
So far, you’ve created a new feature in your Football Trading service where users can list a card for exchange and another user can bid for the traded card. When a new bid is received, it is queued in memory until it is committed as it requires a bunch of complex validations. There are a lot of expectations for this new feature, and you want to be sure it works well. For that reason, you want to monitor the bids that are received, how many bids are pending to be committed, and the duration of this process.
In this recipe, you will learn how to create custom metrics using Micrometer. Micrometer is an open source metrics collection library for Java applications that is very well integrated with Spring Boot Actuator. Other libraries can use the telemetry data generated by Micrometer to export to different monitoring systems.
There are different types of metrics:
- Counter: As the name suggests, it counts how many times something happened. We...