사용자 도구

사이트 도구


springframework:springboot:actuator

Spring Boot Actuator

모든 Actuator 켜기 / 끄기

  • 기본적으로 info, health 정도만 켜져 있음.
management.security.enabled=false # 전체 다 활성화
management.server.port=8081 
management.server.address=127.0.0.1

management.server.port=-1 # http endpoint 끄기

Health Check

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();
	}
 
}

참조

springframework/springboot/actuator.txt · 마지막으로 수정됨: 2019/03/25 20:19 저자 kwon37xi