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.





A humble place to learn Java and Programming better.

Recommended from Medium

SKB — Scala Try

Password Generator with Python

Rethinking the spreadsheet: data entry

Spring Auto REST Docs 2017 Recap

Creating a 99% Invisible Reading List

Effective Beginner-Friendly Messaging for Dweb

How to make Dweb accessible to beginners? (Image source: element5digital on unsplash)

I found this great app called coincircle that gives you free money for simple tasks and the…

TryHackMe | Walking An Application Walkthrough

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.

More from Medium

How To Build, Run and Test a Simple SpringBoot App in Docker — Lab Test Style

Contract Test — Spring Cloud Contract vs PACT

REST API Load performance testing with Apache JMeter

Multiple JDK / Java env setup on Mac