본문 바로가기

Backend/Java

Spring Boot Actuator

반응형

Spring boot starter actuator is a dependency that provides endpoints for application management and application information

List of Contents

Dependencies

▶ Actuator

Provides the endpoints for the application management and information

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Endpoints

Endpoint List

Some of the actuator endpoints are as follows:

▶ actuator/health

Shows the application status

▶ actuator/info

Show the application information. For this, you have to add the information yourself


Use the property name below in the application.properties file to add information. This creates a JSON object with each name coming after the comma becoming the child of what comes before

info.<name>.<name>=<value>


▶ actuator/beans

Shows the bean list registered on the application context

▶ actuator/mappings

Shows all the paths registered as @RequestMapping

Adding Endpoints

▶ Certain Endpoints

By default only the /health endpoint is available. For the rest, we have to add them in the application.properties file using the include property

management.endpoints.web.exposure.include=<endpoint1>,<endpoint2>

▶ All Endpoints

Use * to add all endpoints

management.endpoints.web.exposure.include=*

Removing Endpoints

▶ Certain Endpoints

If you want to remove some endpoints after adding all the endpoints, use exclude

management.endpoints.web.exposure.exclude=<endpoint1>,<endpoint2>

Implementation

Add the dependency in the pom.xml file

Run the app then go to the URL. The browser will show as follows


Some of the endpoints have sensitive information that you don't want to expose to the public. Click the link below to add security

Adding Security


In this writing, we have seen the Spring boot starter actuator.


References

◆ Actuator Endpoint List

Spring Boot Reference Documentation

 

Spring Boot Reference Documentation

This section goes into more detail about how you should use Spring Boot. It covers topics such as building systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe

docs.spring.io

 

728x90
반응형

'Backend > Java' 카테고리의 다른 글

Spring Beans - Dependency Injection  (1) 2023.10.07
Spring Boot Security  (1) 2023.10.01
Data Persistency Tools (JPA, Hybernate, Mybatis)  (3) 2023.09.09
Spring Boot View Template Tools  (0) 2023.09.02
Spring Boot API  (0) 2023.08.23