Skip to content

[feat] TRACE-6 Outbox Dispatcher runtime 계측 및 오류 정제 - #258

Merged
PHJ2000 merged 2 commits into
mainfrom
feature/trace-6-outbox-runtime
Sep 18, 2026
Merged

PHJ2000 merged 2 commits into
mainfrom
feature/trace-6-outbox-runtime

Conversation

@geonusp

@geonusp geonusp commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

✨ Feature PR

🔗 이슈 링크 (필수)

PR 제목: [feat] TRACE-6 Outbox Dispatcher runtime 계측 및 오류 정제
브랜치: feature/trace-6-outbox-runtime


🧩 이 PR의 변경사항 (필수)

전체 중 위치

이 PR에서 변경한 것

  • outbox process 아래에 outbox dispatch child span을 만들고 결과 속성을 기록
  • outbox notification lookup, outbox fcm send, outbox state update 구간을 child span으로 분리
  • 처리 결과를 success, skipped(already_sent), retryable_failure, permanent_failure, error로 구분
  • FCM 실패 span에 outbox.fcm.outcome, 재시도 결과에 outbox.retry.count 기록
  • 처리되지 않은 예외는 outbox.failure.class와 정제 메시지만 기록하고 원본 예외를 재전파
  • SanitizingQueryTracingObservationHandler를 JdbcQueryErrorSanitizingObservationHandler로 이름 변경해 JDBC 전용 책임을 명확화
  • Dispatcher 단위 테스트와 Outbox 통합 테스트에 span 이름·결과 속성·민감값 미기록 검증 추가

범위에서 제외한 것

  • 상위 outbox process span의 오류 정제는 기존 OutboxTracing 구현을 그대로 사용
  • Outbox 상태 전이, FCM 실패 분류, backoff, 트랜잭션 전파 정책 변경 없음
  • Grafana dashboard·alert 추가, Collector/agent 변경 없음

✅ 이 PR이 커버하는 AC (필수)

Covers (이 PR에서 완료)

  • AC1: outbox dispatch, outbox notification lookup, outbox fcm send, outbox state update span 생성
  • AC2: 정상/스킵/재시도/영구 실패 결과를 span 속성으로 구분
  • AC3: span에 원본 예외 message, 업무 식별자, SQL 값을 기록하지 않음 (error.type, outbox.failure.class만 기록)
  • AC4: ./gradlew test --tests 'com.beachcheck.outbox.*' --tests 'com.beachcheck.global.tracing.*' 대상 테스트 보강 및 통과
  • AC5: gradlew check 통과

Not covered (후속 작업)


🧪 테스트 결과 (필수)

로컬

gradlew.bat --no-daemon spotlessApply check --console=plain
  • ✅ 통과 (커밋 23156171 검증 기록)

CI

  • 자동 실행 결과를 PR에 반영

Smoke 테스트


🧭 영향 범위 체크 (필수)

  • API 변경
  • DB 변경
  • 설정 변경
  • Breaking change
  • Outbox tracing 영향 (OutboxEventDispatcher가 Tracer를 주입받음, 업무 처리 정책은 유지)

💬 리뷰 포인트 (필수)

  • 집중해서 볼 파일/로직: OutboxEventDispatcher의 span 경계와 finally 종료 처리, sendFcm의 실패 분류, JdbcQueryErrorSanitizingObservationHandler 이름 변경 영향
  • 트레이드오프/대안: FCM SDK 자체 client span을 쓰지 않고 애플리케이션 span으로 감싸는 방식을 선택
  • 확인 요청: outbox.item.outcome의 error 값과 상위 outbox process 정제 메시지가 중복 기록으로 보이지 않는지

- dispatch, 알림 조회, FCM 전송, 상태 갱신 child span과 결과 속성을 추가
- 처리된 FCM 실패는 자식 span에 정제해 기록하고 기존 상태 전이 및 상위 span 상태를 유지
- JDBC 오류 정제 핸들러 이름을 책임에 맞게 변경하고 tracing 회귀 테스트를 보강
- 검증: gradlew.bat --no-daemon spotlessApply check --console=plain 통과
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 38a5d31a-83be-46c2-8710-00030aaf89a8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@geonusp geonusp self-assigned this Sep 16, 2026

@PHJ2000 PHJ2000 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

non-blocking : #253은 #254에서 해결됐으니, AC6와 Smoke 테스트 설명에 남아 있는 선행 조건을 제거해 주세요. dev 배포 후 Tempo 검증이 필요하다는 내용만 남기면 될 것 같습니다.

Comment thread src/main/java/com/beachcheck/outbox/service/OutboxEventDispatcher.java Outdated
@geonusp

geonusp commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator Author

non-blocking : #253은 #254에서 해결됐으니, AC6와 Smoke 테스트 설명에 남아 있는 선행 조건을 제거해 주세요. dev 배포 후 Tempo 검증이 필요하다는 내용만 남기면 될 것 같습니다.

AC6는 그렇다 쳐도 Smoke 테스트 설명에 남아있는 선행 조건은 있어도 어색하지 않다고 봐서 남겨놨습니다.

- DB 커밋 전 success span 결과와 성공 로그 기록을 지연

- 롤백 시 dispatch span을 error로 기록하고 트랜잭션 완료 후 종료

- 커밋 전 성공 및 롤백 오류 결과 회귀 테스트 추가

- 검증: gradlew.bat --no-daemon spotlessApply check --console=plain
@PHJ2000

PHJ2000 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

수고하셨습니다

@PHJ2000
PHJ2000 merged commit 56da8b4 into main Sep 18, 2026
3 checks passed
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.

[TRACE-6] Outbox Dispatcher runtime 계측 및 오류 정제

2 participants