본문 바로가기

서버

Spring boot3 - Spring Actuator 사용하여 health check 하기

728x90

1. 라이브러리 가져오기

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

 

2. application.properties에 보고 싶은 server 내용 넣기

management.endpoints.web.exposure.include=health,metrix

#혹은 전부 보고싶을 때는 아래 처럼 설정

#management.endpoints.web.exposure.include=*

 

 

3. 접속해서 확인하기

 

기본은 주소는

http://도메인/actuator

 

만약 configProps에 대해 보고싶다면

http://도메인/actuator/configProps

 

 

 

 

 

서버 요청에 대한 서버 값을 보고싶다면

 

http://localhost:8080/actuator/metrics/http.server.requests