In this guide, let’s add a custom actuator endpoint to Spring Boot application.

Table of contents

  1. Create spring boot application
  2. Create a custom weather endpoint
  3. Test weather endpoint

Create spring boot application

Let’s create a very basic spring boot application using Spring Initializr for the purpose of this tutorial.

Create a Spring Boot starter project using Spring Initializr

Let’s utilize the pre-configured Spring Initializr which is available here to create actuator-custom-endpoint-basics starter project.

Click on Generate Project. This downloads a zip file containing actuator-custom-endpoint-basics project. Import the project to your IDE.

Check the default health indicator URL


  "status": "UP"

Create a custom weather endpoint

@Endpoint(id = "weather")
public class WeatherEndPoint {

  public RestTemplate restTemplate() {
    return new RestTemplate();

  RestTemplate restTemplate;

  public Map<String, String> check() {
    try {
      return restTemplate.getForObject("", Map.class);
    } catch (Exception e) {
      return Collections.singletonMap("status", e.getMessage());

Enable weather endpoint



Test weather endpoint


    "status": "OK"


This concludes our guide to adding a custom actuator end point to Spring Boot Application.

Your feedback is always appreciated. Happy coding!