Spring Boot Actuator
September 10, 2021

M04 Q30 What is metrics for?

Spring Actuator provides metrics endpoint which can be used to examine metrics collected by the application during runtime.

metrics endpoint allows you to view information about specific metric by visiting metric dedicated URI, for example /actuator/metrics/process.cpu.usage

metrics endpoint allows you to drill down information further by usage of available tags, for example /actuator/metrics/jvm.memory.used?tag=area:heap

metrics endpoint allows you to view many out-of-the box defined metrics:

  • CPU Usage, CPU Core Count
  • Memory Usage, Max Memory Available
  • Threads Info
  • Garbage Collector Statistics
  • HTTP Requests Info
  • Embedded Tomcat Related Metrics
  • ... (many more, also you can define custom metrics)

metrics endpoint is not exposed via Web by default, to have it available, you need to add following entry to application.properties: management.endpoints.web.exposure.include=metrics