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

Quick Notes — AWS EC2 Instance Storage

How bad hardware can ruin a software developer’s workday

Unity — Explosion implementation continued

Kata Containers — IBM Cloud Case Study

Zuri / HNG Internship Experience so Far

Moving from Goal Setters to System Builders

Example of Deploying psycopg2-binary Python package as an AWS Lambda Layer

Getting Setup For ASP.NET MVC

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

Spring Cloud Config| Configuring Random Values in properties.

Simple Implementation of Spring Cloud OpenFeign

Spring Cloud OpenFeign

Kubernetes Tutorial | Setup Kubernetes in Windows & Run Spring boot application on k8s cluster

Configuring Vault with Spring Boot