문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
springframework:springboot:actuator [2018/03/28 16:32] kwon37xi |
springframework:springboot:actuator [2022/10/27 12:38] (현재) kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Spring Boot Actuator ====== | ====== Spring Boot Actuator ====== | ||
* [[springframework: | * [[springframework: | ||
+ | * **actuator** 정보를 외부에 노출해서는 절대로 안된다.** 운영 웹서버에서는 방화벽으로 막거나, HTTP가 아닌 다른 방식으로 노출 방식을 바꾸고, 외부에는 HTTP/HTTPS 포트만 노출시켜야 한다. | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
줄 15: | 줄 16: | ||
</ | </ | ||
+ | ===== Health Check ===== | ||
+ | * [[https:// | ||
+ | <code java> | ||
+ | import org.springframework.boot.actuate.health.Health; | ||
+ | import org.springframework.boot.actuate.health.HealthIndicator; | ||
+ | import org.springframework.stereotype.Component; | ||
+ | |||
+ | @Component | ||
+ | public class MyHealthIndicator implements HealthIndicator { | ||
+ | |||
+ | @Override | ||
+ | public Health health() { | ||
+ | int errorCode = check(); // perform some specific health check | ||
+ | if (errorCode != 0) { | ||
+ | return Health.down().withDetail(" | ||
+ | } | ||
+ | return Health.up().build(); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | * [[https:// | ||
+ | |||
+ | ===== 참조 ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |