Spring Boot - Actuator

이정수·2025년 10월 18일

Spring Boot

목록 보기
7/25

Spring Boot Actuator

。 Production 단계의 Application을 모니터링하고 관리.
▶ Application의 Background에서 endpoint를 통해 어떤 작업이 발생하는지 확인하는 등의 정보를 제공하는 역할을 수행.

。여러 Endpoint를 제공.

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

pom.xml에 다음 starter 구문을 넣고 maven을 재실행 후 http://localhost:8080/actuator 접속.

▶ JSON Format으로 현재 Page의 URL로 연결되는 self link / health URL로 연결되는 health link가 반환.
。Actuator의 추가 기능을 사용 시 application.properties에서 추가기능을 정의.
▶ 기본적으로 actuator을 작동하면 actuator이 제공하는 health endpoint만 노출되며 더 많은 endpoint를 좀 더 노출시키기 위해 다음 구문을 추가.

# health , metrics의 특정 endpoint 노출 시
management.endpoints.web.exposure.include=health,metrics
# 모든 end point를 노출 할 경우.
management.endpoints.web.exposure.include=*

endpoint를 많이 노출하면 해당 정보를 많이 수집한다는 것을 의미하며 이는 CPU와 메모리를 많이 사용한다는 의미이므로 좋지 않다.

end point 종류

  • beans endpoint :
    application에 포함된 모든 spring bean을 해당 endpoint를 이용하여 선언.

  • health endpoint :
    application의 정상작동 여부 등 의 상태 정보를 확인

  • metrics endpoint :
    application 관련 metrics 정보를 확인

  • mapping endpoint :
    application에서 정의된 모든 request mapping 관련 세부 사항

  • configprops endpoint :
    application.properties에서 설정 가능한 모든 항목들이 표시.

  • env endpoint :
    application 환경에 관한 세부 사항을 모두 표시.
profile
공부기록 블로그

0개의 댓글