chapter ten
This chapter covers:
- The role of metrics in a microservices architecture
- Types of metrics
- Creating custom metrics
- Metrics scopes
- Viewing metrics in Grafana
- MicroProfile Metrics and Micrometer metrics
MicroProfile Metrics exposes runtime metrics like CPU and memory utilization and can also expose custom application performance and business metrics. Exposed metrics can be forwarded to graphing systems like Grafana and viewed in dashboards representing a live view of running microservices. A live view of metrics can improve business performance and improve application availability.
This chapter will instrument the Chapter 7 Account Service and Transaction Service with metrics using MicroProfile Metrics APIs, with a section covering the Quarkus Micrometer metrics extension.
The following section explains the benefits of metrics.
Instrumenting runtimes and applications with metrics offer benefits like the following: