scouter icon indicating copy to clipboard operation
scouter copied to clipboard

Xlog Exception error 제외 문의 드립니다.

Open tuop2000 opened this issue 5 years ago • 1 comments

안녕하세요. 비슷한 이슈가 #605 에 있는거 같은데 해당 방법으로 적용해도 error로 마킹되어 문의드립니다.

java / netty 를 사용하고 있습니다.

//hook service 시작점을 netty handler의 channelRead로 설정하였습니다. hook_service_patterns=kr.sample.handler.SocketHandler.channelRead

handler 안에서 L4 health check 등 특정 상황 일 경우 java.lang.Exception을 상속받은 kr.sample.exception.RejectException / kr.sample.exception.HealthCheckException throw 시켜서 kr.sample.handler.SocketHandler.exceptionCaught로 넘어가면 Class에 맞게 처리하고 있습니다.

public void channelRead(ChannelHandlerContext ctx, Object msg) throws HealthCheckException{
  
     ....... 

    if(isL4 ==true){
      throw new HealthCheckException();
     }
}

//throw 발생 시 method로 전달되어 처리
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause){
  
   if(cause instanceof  HealthCheckException){
   
       .....
       .....
       ctx.close()
   }

}

L4에서 유입되는 Health Check가 유입되어 throw되어 Exception이 발생하는 경우 error로 마킹되어 Alert이 발생되는 것을 막고자 다음과 같이 설정하였습니다.

hook_exception_exclude_class_patterns=kr.sample.exception.HealthCheckException

해당 옵션을 적용해도 Xlog에 error로 마킹이 되어 Alert이 발생하게 되는데요. 특정 Exception을 제외하는 방법이 궁금합니다.

tuop2000 avatar Sep 24 '19 01:09 tuop2000

에러로 마킹되는 경우는 SQL 에러, HTTP 통신 에러 그리고 처리되지 않은 에러입니다. 에러 처리가 되었는데 에러로 마킹된다고 하셨는데 특별한 처리를 하신건가요? (exception class나 handler 설정) hook_exception_ 으로 시작되는 옵션에 설정 하신게 있으신가요?

gunlee01 avatar Oct 28 '19 02:10 gunlee01