Spring Framework has some built-in features for monitoring and providing metrics to know the health of applications. We have multiple ways to do this, so let's review some of them:
- We can use an old-fashioned approach that implies creating interceptors around methods to log everything we want around them.
- Spring Actuator can be used along side Spring Boot applications. Using this library, we can review the health of an application; it provides an easy way to monitor applications via HTTP requests or JMX. Additionally, we can use tools to index the data produced and to create graphs that are helpful to understand the metrics. There are plenty of options to create graphs, including:
- ELK Stack (ElasticSearch, ...