Spring Boot provides state-of-the-art support for generating various metrics using actuator and micrometer. We already added Hystrix in api-service, created in the last section. We'll continue updating the api-service code that generates the various metrics required for monitoring.
Spring Boot makes developers' work easy and provides all of the libraries and configuration to support various metrics. We can make the following changes to the api-service, which would enable and generate various metrics.
Update the API service using the following steps:
- Maven dependency: We must include the spring-boot-starter-actuator dependency, shown as follows, to generate different metrics (this automatically includes micrometer dependencies, ...