Analyzing the Actuator's endpoints

Spring Boot's Actuator offers you several web endpoints; these let you monitor your running Spring application and you can view the internals of your application in production. It provides you a number of predefined endpoints for your Spring application, but you can also add your own custom endpoint for monitoring your application in production.

For example, the health endpoint provides basic application health information and you can also find out how beans are wired together in the Spring application context, determine what environment properties are available to your application, get a snapshot of runtime metrics, and more.

You can easily make use of your application and optimize it by invoking HTTP endpoints if your application is configured with Spring Boot Actuator. There is a wide range of HTTP endpoints that Spring Boot Actuator can support. Some of these are:

  • Bean details
  • Logger details
  • Configuration details
  • Health details
  • Version details

With these built-in endpoints in Spring Boot Actuator, it also allows you to add your own endpoint or customize an existing one. Spring Boot sets the sensitive default to some HTTP endpoints, which cannot be exposed publicly. These endpoints require a password or a username.

The Spring Boot's Actuator exposes a number of endpoints in multiple ways, but these depend on the technology you are using. Once Spring Boot Actuator is configured into your application, it provides you several Actuator REST endpoints. If you are choosing HTTP web endpoints, then you can see the following endpoints:

REST endpoints

Description

/actuator

It gives a discovery platform in place of a page for other endpoints. To enable Actuator, you have to put Spring HATEOS on the classpath. Actuators are sensitive by default and hence require username and password, or they can be disabled due to disabled web security.

/auditevents

All information on audit and events is contained in this endpoint.

/autoconfig

It provides an auto-configuration report of all the auto-configurations applied in the application.

/beans

It shows all the beans configured in the application. Beans are super important for applications configured in Spring. It is an object that is initialized, assembled, and managed in Spring IoC container.

/configprops

It shows you the details of config properties.

/dump

This is for dumping a thread.

/env

It shows different properties of all configurable environments in Spring.

/flyway

This helps when you want to see database migrations.

/health

This displays the health information of an application. Health information includes security, authentication of connections made, and message details of authentications for an application.

/info

This is the arbitrary application information.

/loggers

You can use it if you want to show or change the config of different loggers in your application.

/liquibase

This is in case you want to see migrations of liquibase.

/metrics

This shows metric information for an application.

/mappings

This shows a queue of the entire request mapping paths in the application.

/shutdown

It is enabled to allow the application a graceful shutdown. Spring Boot Actuator does not enable it by default. You will have to enable it should you require it.

/trace

Shows trace data (timestamp, headers, and so on) which is the 100 latest HTTP requests.

 

The preceding table has several web endpoints. You can organize these endpoints into the following three categories:

  • Configuration endpoints
  • Metrics endpoints
  • Application information endpoints

Let's take a look at how to expose these endpoints that provide insight into the configuration of your application. Since endpoints may contain sensitive information, careful consideration should be given about when to expose them. Out of the box, Spring Boot will expose all enabled endpoints over JMX, but only the health and info endpoints over HTTP.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.188.244