I just announced the new Learn Spring course, focused on the fundamentals of Spring 5 and Spring Boot 2:

1. Overview

In this tutorial, we’re going to develop a reactive microservice application with Kotlin and Spring Boot.

Our application will expose a REST API, persist data in a database and have endpoints for monitoring.

2. Use Case

These days many of us are struggling with health problems, hence we've chosen a health tracker application for our tutorial. It allows people to create their health profile, save symptoms like fever, blood pressure and so on. Later, users can see reports about their health logs.

Let's stay safe and healthy and continue our journey.

3. Application Setup

First, we’re going to set up project dependencies. Here we use Maven, but both Maven and Gradle are suitable for us.

8. Monitoring Endpoints

Spring Boot Actuator exposes endpoints to monitor and manage our application. When we add the spring-boot-starter-actuator to dependencies, by default the /health and the /info endpoints are enabled. We can enable more endpoints by setting the value of the management.endpoints.web.exposure.include property in our application.yml.

Let's enable /health and /metrics for our application:

management.endpoints.web.exposure.include: health,metrics

We also can enable all endpoints by setting the value to *. Be aware that exposing all endpoints may cause security risks, hence we'd need additional security configurations.

We can see a list of all enabled actuator endpoints by calling /actuator.