Skip to content

Conversation

@gksdud1109
Copy link
Collaborator

@gksdud1109 gksdud1109 commented Oct 26, 2025

관련 이슈

PR / 과제 설명

  • micrometer, actuator 도입하여 성능지표 수집

  • securityconfig 해당 엔드포인트 ("/actuator/health", "/actuator/metrics/**", "/actuator/prometheus") 임시로 열어놨습니다

    • 실 운영환경에서는 내부망에서만 접근하도록해서 병목제거 + 보안
    • 필요하다면 spring 보안 설정에 ip화이트리스트 추가
    • 필요하다면 특정 계정으로만 접근 설정 추가
  • 이제 엔드포인트에서 challenge도메인 하위 패키지에 있는 controller,service,repository 메서드들의 실행 시간 등의 지표를 볼 수 있습니다.

  • perf 아래에 있는 prometheus, grafana, k6 통합 세팅으로 ./run-loadtest.sh 명령어 하나로 /perf/k6-scripts하위에 구현된 테스트 시나리오로 부하 테스트가 가능합니다

공부 과정은 아래 노션 참고, gpt와 기술블로그 보면서 구현한 과정을 아래 노션에 정리해놨습니다
https://www.notion.so/2979d0051b9980218657d216e5bfaf63?source=copy_link

<k6 테스트결과 로그파일>
image

<grafana 테스트결과 시각화>
image

@gksdud1109 gksdud1109 linked an issue Oct 26, 2025 that may be closed by this pull request
@gksdud1109 gksdud1109 changed the title micrometer도입, aop기반 로깅 및 지표수집 구현 micrometer, actuator기반 로깅 및 지표수집 / k6 부하테스트 구현 Oct 27, 2025
Comment on lines +84 to +87
// 토큰 존재 여부 확인
if (accessToken == null || accessToken.isBlank()) {
throw new BusinessException(AuthErrorCode.TOKEN_INVALID);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gksdud1109 이 부분은 아래쪽에 payload에서 예외처리가 되어 있고, 재발급 로직 고려하면 TOKEN_EXPIRED 예외처리보다 먼저 이루어지면 안되서 아예 삭제해주시면 됩니다!

@heygeeji
Copy link
Collaborator

이렇게 수정하신 이유 다시 알려주실 수 있나요?

@gksdud1109
Copy link
Collaborator Author

gksdud1109 commented Oct 27, 2025

k6에서 다수 유저가 api요청을 하는 상황을 만들어서 부하테스트를 한건데요
api요청에는 결국 우리 서비스 api 대부분이 로그인 인증(getActor)을 거쳐야하기 때문에 이걸 통과시키는 jwt세팅이 필요했습니다

근데 이 친구들이 수동 http요청을 서버에 날리는 환경이 브라우저가 아니기 때문에 cookie를 담는 객체를 가지고 있지 않아용
흉내는 낼수 있지만 제한적이기도하고 불안정해서 일반적으로도 k6테스트에서는 bearer방식을 쓰는것으로 알아봤습니다

그래서 bearer헤더 방식 jwt토큰인증이 필요했는데 지금 코드상에서 순서만 조금 바꾸면 사용이 가능할것 같아서 요렇게 수정하고 진행했습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE] AOP기반 서버 내부 실행시간 측정 구현

3 participants