Spring Boot Actuator – Production Ready Features


Spring Boot Actuator that includes additional features to help you monitor and manage your application in production. You can monitor your application’s auditing, health, and metrics by using HTTP endpoints or with JMX.

Spring Boot Actuator includes a number of built-in endpoints and lets you add your own. For example, the health endpoint provides basic application health information.


Spring Boot provides built-in endpoints as well as lets you add your own. You can check a list of endpoints at https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

Enabling Endpoints

By default all end points except for shutdown are enabled. You can enable a particular endpoint using management.endpoint.enabled property in your properties file. For example, if you want to enable the shutdown endpoint then you can use management.endpoint.shutdown.enabled=true.

If you want to disable all default endpoints then you can use management.endpoints.enabled-by-default=false and you can enable individual endpoint as per your requirements.

Endpoints – to expose or not

Since Endpoints may contain sensitive information, careful consideration should be given about when to expose them. The default exposure for the built-in endpoints can be found at https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html.

Now we will see how to work with Spring Boot Actuator by creating examples.


Java at least 8, Eclipse 2019-12, Spring Boot 2.2.5, Gradle 6.1.1, Maven 3.6.3

Create Project

Create a gradle or maven based project in Eclipse. The name of the project is spring-boot-actuator.

Once your project creation is done then update the build.gradle script with the following code:

buildscript {
	ext {
		springBootVersion = '2.2.5.RELEASE'
    repositories {
    dependencies {

plugins {
    id 'java-library'
    id 'org.springframework.boot' version "${springBootVersion}"

sourceCompatibility = 12
targetCompatibility = 12

repositories {

dependencies {

In the above build script we have added the required dependencies – web and actuator starters.

If you are creating maven based project then you can use below pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">





					<source>at least 8</source>
					<target>at least 8</target>

Create Main Class

Create below main class to start up the Spring Boot application. A class is having main method with @SpringBootApplication is enough to deploy the application into embedded Tomcat server.

package com.roytuts.springboot.actuator.main;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class ActuatorApplication {

	public static void main(String[] args) {
		SpringApplication.run(ActuatorApplication.class, args);


Testing the Application

Run the above main class that will deploy the application and start the server at default Tomcat server’s port 8080.

Now when you hit the URL http://localhost:8080/actuator/health, then you will see the following output on the browser:

spring boot actuator - production ready features

By default, the health endpoint is mapped to /actuator/health, where /actuator is prefix.

From the output it is obvious that the application is up and running.

If you hit /actuator/info that displays arbitrary application’s info but here it won’t show anything here:

spring boot actuator

Now if you add below information into classpath file application.properties:

info.app.name=Spring Boot Actuator Example
info.app.type=Spring Boot 2.2.5

Hit the same URL in the browser, you will see below output on the browser:

spring boot actuator

Discovery Page

A “discovery page” is added with links to all the endpoints. The “discovery page” is available on /actuator by default. This endpoint shows you all endpoint links for your Spring Boot application.

So you will get the below output for our application:

spring boot actuator

Customizing Base Path of Endpoints

By default the base path of the Actuator is /actuator but you can change it to other. For example, if you want to point Actuator’s base path to /management then you can add below into application.properties file.


Now you can access URL as http://localhost:8080/management/info.

Exposing Other Endpoints

By default for security reasons only /info and /health endpoints are enabled over HTTP. If you want to expose other endpoints then you can add below properties to application.properties file.

If you want to expose all endpoints then add:


Now you would be able to access all endpoints over HTTP.

spring boot actuator

If you want specific endpoints to be enabled then you can add specific endpoints:


Now you would be able to access above endpoints over HTTP.

spring boot actuator

Source Code

download source code

Thanks for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *