Enabling monitoring

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:

  1. Maven dependency: We must include the spring-boot-starter-actuator dependency, shown as follows, to generate different metrics (this automatically includes micrometer dependencies, ...

Get Mastering Microservices with Java - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.