사용자 도구

사이트 도구


springframework:springboot:actuator

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
springframework:springboot:actuator [2018/08/21 13:30]
kwon37xi
springframework:springboot:actuator [2018/08/21 13:33]
kwon37xi [Health Check]
줄 17: 줄 17:
 ===== Health Check ===== ===== Health Check =====
   * [[https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html#_writing_custom_healthindicators|Writing CUstom Health Indicators]]   * [[https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html#_writing_custom_healthindicators|Writing CUstom Health Indicators]]
 +<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("Error Code", errorCode).build();
 + }
 + return Health.up().build();
 + }
 +
 +}
 +</code>
   * [[https://docs.spring.io/spring-boot/docs/2.0.x/reference/html/common-application-properties.html|Common Application Properties]]에서 ''management.health'' 참고.   * [[https://docs.spring.io/spring-boot/docs/2.0.x/reference/html/common-application-properties.html|Common Application Properties]]에서 ''management.health'' 참고.
  
springframework/springboot/actuator.txt · 마지막으로 수정됨: 2022/10/27 12:38 저자 kwon37xi