Published in


Add Actuator to a spring boot application

Actuator is a spring boot module that allows to monitor and manage application usages in a production environment, without coding and configuration for any of them.

There are three main features of the Spring Boot Actuator:

  • Endpoints
    The actuator endpoints allow us to monitor and interact with the application. Spring Boot provides a number of built-in endpoints. We can also create our own endpoint. For example, the /health endpoint provides the basic health information of an application.
  • Metrics
    It provides dimensional metrics by integrating with the micrometer. Micrometer is the instrumentation library powering the delivery of application metrics from Spring. It provides vendor-neutral interfaces for timers, gauges, counters, distribution summaries, and long task timers with a dimensional data model.
  • Audit
    Spring Boot provides a flexible audit framework that publishes events to an AuditEventRepository. It automatically publishes the authentication events if spring-security is in execution.

Enabling Spring Boot Actuator

  1. Add the dependency to pom.xml file

2. Add configuration to the file

##Different port for management APIs
##Different basepath for management APIs
##Include all the endpoint APIs
##To expose only selected endpoints
##Roles used to determine whether or not a user is authorized to be shown details."ROLE_ADMIN"

That's it. you can see your endpoints at base url /management

base path /management

Detailed usage of Metrics and Audits are not covered in this article.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Himanshu Pratap

Himanshu Pratap

System Administrator and Full stack web developer.