[DEV] 기록

[SpringBoot] Prometheus 연동시 "INVALID" is not a valid start token

꾸준함. 2022. 8. 31. 22:41

개요

Spring Security가 적용된 프로젝트에서 actuator를 적용하고 프로메테우스와 연동했을 때 아래와 같은 오류 메시지와 함께 State가 DOWN인 것을 확인했습니다.

"INVALID" is not a valid start token

 

원인

Spring Security가 적용되어 endpoint를 접근할 수 없어 발생하는 문제였습니다.

 

해결 방법

actuator가 endpoint에 접근할 수 있도록 actuator 관련 url에 대해서는 Spring Security가 적용되지 않도록 처리해주면 해결이 됩니다.

@Override
public void configure(WebSecurity web) throws Exception {
    web.ignoring()
        .antMatchers("/actuator/**");
}

 

제외 처리를 완료할 경우 아래와 같이 State가 UP으로 변경된 것을 확인할 수 있습니다.

반응형