Skip to content

모니터링 추가#241

Merged
Hwanvely merged 2 commits intodevfrom
feat/monitoring
Apr 7, 2026
Merged

모니터링 추가#241
Hwanvely merged 2 commits intodevfrom
feat/monitoring

Conversation

@Hwanvely
Copy link
Copy Markdown
Collaborator

@Hwanvely Hwanvely commented Apr 7, 2026

관련 이슈

변경 사항

AS-IS

Spring Actuator 및 Prometheus 메트릭 수집 기능이 없었음
Rolling 배포 시 drain 설정 후 즉시 새 이미지를 pull하여, 기존 연결이 완전히 종료되기 전에 배포가 진행되는 문제가 있었음
application-production.yml에서 session cookie same-site 설정 위치가 잘못되어 있었음 (server 하위에 위치)

TO-BE

spring-boot-starter-actuator 및 micrometer-registry-prometheus 의존성 추가
application.yml (기본): actuator 엔드포인트 기본 비노출 설정
application-dev.yml: health, prometheus, loggers 엔드포인트 노출
application-production.yml: health, prometheus 엔드포인트 노출, 애플리케이션/환경 태그(snackgame, production) 추가
Rolling 배포 스크립트(deploy-rolling.sh)에서 drain 설정 후 15초 대기하여 기존 연결이 안전하게 종료된 뒤 배포 진행
application-production.yml의 session cookie same-site: none 설정을 올바른 위치(spring.servlet.session.cookie)로 이동

@Hwanvely Hwanvely self-assigned this Apr 7, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request integrates Spring Boot Actuator and Micrometer for monitoring, configuring Prometheus endpoints across various environments. It also introduces a delay in the deployment script to facilitate connection draining. Key feedback points out that session cookie configurations were incorrectly moved to the 'spring' namespace and must remain under 'server' to be recognized. Furthermore, using 'same-site: none' necessitates the 'secure: true' attribute for browser compatibility. There is also a recommendation to refine the hardcoded sleep duration in the deployment script to better handle varying connection draining times.

Comment on lines +9 to +13
servlet:
session:
cookie:
same-site: none

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

세션 쿠키 설정은 spring.servlet이 아닌 server.servlet 하위에 위치해야 정상적으로 적용됩니다. 이 블록은 잘못된 경로에 있으므로 삭제하고, 아래 server 블록 내의 기존 설정을 수정하여 사용해 주세요.

Comment on lines 19 to -22
refresh-secret-key: ${REFRESH_TOKEN_SECRET_KEY}
refresh-expiry-days: ${REFRESH_TOKEN_EXPIRY_DAYS}

server:
port: ${APPLICATION_PORT}
forward-headers-strategy: native
servlet:
session:
cookie:
same-site: none
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

이 설정을 삭제하지 말고 유지해 주세요. spring.servlet으로 옮기면 Spring Boot에서 설정을 인식하지 못합니다. 또한, same-site: none 속성을 사용할 경우 최신 브라우저의 보안 정책에 따라 Secure 속성이 필수적이므로 secure: true 설정을 함께 추가해야 합니다.

  servlet:
    session:
      cookie:
        same-site: none
        secure: true

set_drain true

echo "기존 연결 종료 대기..."
sleep 15
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

sleep 15는 기존 연결이 종료되기를 기다리는 임시적인 수치입니다. 애플리케이션의 최대 요청 처리 시간이나 NLB의 드레인 설정이 실제로 반영되는 시간을 고려했을 때 15초가 충분하지 않을 수 있습니다. 이 값을 환경 변수로 관리하거나, 가능하다면 실제 활성 연결 수를 체크하는 로직을 검토해 보시기 바랍니다.

@Hwanvely Hwanvely merged commit 488ec6f into dev Apr 7, 2026
3 checks passed
Hwanvely added a commit that referenced this pull request Apr 7, 2026
* 피버타임 검증 시 점수가 두배가 되지 않는 현상 해결 (#226)

* fix: 피버타임 검증 시 점수가 두배가 되지 않는 문제 해결

* refactor: 바뀐 dto에 맞게 BIZ 및 test 수정

* 세션 일시정지시 피버타임을 멈추지 못하던 문제 해결 (#227)

* fix: 피버타임 검증 시 점수가 두배가 되지 않는 문제 해결

* refactor: 바뀐 dto에 맞게 BIZ 및 test 수정

* fix: 피버타임중 일시정지 시 피버타임도 멈추게 한다

* refactor: 인터페이스로 묶는다

* 피버타임 관련 문제 해결 (#228)

* fix: 점수 증가 로직 오류 해결

* fix: 스트릭 발생 시각을 받는다

* refactor: 네이밍 수정

* fix(test): 스트릭 발생 시각 추가

* fix: 피버타임 검증 시 일반 스트릭이 검증안되던 문제해결 (#229)

* fix: 피버타임 네트워크 지연 문제 해결 (#231)

* 피버타임 일시정지 동기화 및 지연시간 문제 해결 (#232)

* fix: 치팅 및 네트워크 지연 해결

* comment: 디버깅을 위한 로그 추가

* fix: session과 fevertime 일시정지 동기화

* OCI용 CD 파이프라인 마이그레이션 (#234)

* fix: 치팅 및 네트워크 지연 해결

* comment: 디버깅을 위한 로그 추가

* fix: session과 fevertime 일시정지 동기화

* fix: 세션 예외 오류 해결

* feat: multipart 예외 핸들링

* refactor: CD 파이프라인 OCI로 마이그레이션

* fix: end response 분리

* OCI 경로 수정 (#236)

* fix: 치팅 및 네트워크 지연 해결

* comment: 디버깅을 위한 로그 추가

* fix: session과 fevertime 일시정지 동기화

* fix: 세션 예외 오류 해결

* feat: multipart 예외 핸들링

* refactor: CD 파이프라인 OCI로 마이그레이션

* fix: end response 분리

* fix: oci 경로 수정

* fix: oci 옵션 수정

* fix: shebang 추가

* fix: oci 옵션 수정

* fix: drain 경합으로 인한 409 해결

* 모니터링 추가 (#241)

* feat: drain 연결 종료 대기 추가

* feat: actuator 추가
Hwanvely added a commit that referenced this pull request Apr 7, 2026
* 피버타임 검증 시 점수가 두배가 되지 않는 현상 해결 (#226)

* fix: 피버타임 검증 시 점수가 두배가 되지 않는 문제 해결

* refactor: 바뀐 dto에 맞게 BIZ 및 test 수정

* 세션 일시정지시 피버타임을 멈추지 못하던 문제 해결 (#227)

* fix: 피버타임 검증 시 점수가 두배가 되지 않는 문제 해결

* refactor: 바뀐 dto에 맞게 BIZ 및 test 수정

* fix: 피버타임중 일시정지 시 피버타임도 멈추게 한다

* refactor: 인터페이스로 묶는다

* 피버타임 관련 문제 해결 (#228)

* fix: 점수 증가 로직 오류 해결

* fix: 스트릭 발생 시각을 받는다

* refactor: 네이밍 수정

* fix(test): 스트릭 발생 시각 추가

* fix: 피버타임 검증 시 일반 스트릭이 검증안되던 문제해결 (#229)

* fix: 피버타임 네트워크 지연 문제 해결 (#231)

* 피버타임 일시정지 동기화 및 지연시간 문제 해결 (#232)

* fix: 치팅 및 네트워크 지연 해결

* comment: 디버깅을 위한 로그 추가

* fix: session과 fevertime 일시정지 동기화

* OCI용 CD 파이프라인 마이그레이션 (#234)

* fix: 치팅 및 네트워크 지연 해결

* comment: 디버깅을 위한 로그 추가

* fix: session과 fevertime 일시정지 동기화

* fix: 세션 예외 오류 해결

* feat: multipart 예외 핸들링

* refactor: CD 파이프라인 OCI로 마이그레이션

* fix: end response 분리

* OCI 경로 수정 (#236)

* fix: 치팅 및 네트워크 지연 해결

* comment: 디버깅을 위한 로그 추가

* fix: session과 fevertime 일시정지 동기화

* fix: 세션 예외 오류 해결

* feat: multipart 예외 핸들링

* refactor: CD 파이프라인 OCI로 마이그레이션

* fix: end response 분리

* fix: oci 경로 수정

* fix: oci 옵션 수정

* fix: shebang 추가

* fix: oci 옵션 수정

* fix: drain 경합으로 인한 409 해결

* 모니터링 추가 (#241)

* feat: drain 연결 종료 대기 추가

* feat: actuator 추가

* Grafana Env 추가 및 배포 스크립트 수정 (#243)

* feat: drain 연결 종료 대기 추가

* feat: actuator 추가

* feat: grafana 환경변수 추가

* refactor: 앱 컨테이너만 교체하도록 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant