Testing endpoints

In version 2 of  Spring Boot, the Spring Actuator management endpoints are disabled by default, because these endpoints can have sensitive data of a running application. Then, we need to configure to enable these endpoints properly.

There is a special point to pay attention to. If the application is exposed publicly, you should protect these endpoints.

Let's enable our management endpoints:

management:  endpoints:    web:      expose: "*"

In the preceding configuration, we enabled all the management endpoints, and then we can start to test some endpoints.

Let's test some endpoints. First, we will test the metrics endpoints. This endpoint shows the metrics available for the running application. Go to http://localhost:8081/actuator/metrics ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.