Open
Conversation
- HTTP 요청 횟수와 요청 처리 시간수집
- /metrics 요청은 공통 응답 포맷 변환을 건너뛰도록 예외 처리 - 모든 HTTP 요청에 대해 메서드, 경로, 상태 코드 기준으로 메트릭을 수집
- Outbox 이벤트 발행 성공, 실패 Counter 메트릭으로 기록 - 처리 시간을 Histogram 메트릭으로 기록 - 상태 변경(from -> to status) 카운트 - 데드레터 발생 건수를 별도 메트릭으로 분리
- 메시지 발행 성공, 실패, 소비 ACK, NACK Counter 메트릭 - 처리 시간(초)을 Histogram으로 관측 - 메시지 큐의 인플라이트(in-flight) 상태를 Gauge 메트릭으로 기록
- 인덱싱/업데이트/삭제 작업의 성공, 실패 건수를 Counter 메트릭으로 기록 - 처리 시간을 Histogram으로 확인 - 레코드 동기화 이벤트 발생을 별도 Counter 메트릭으로 기록
- Outbox, RabbitMQ, Elasticsearch 별 Counter, Gauge, Histogram 프로바이더정의
- OutboxMetricsService, RabbitMQMetricsService, ElasticsearchMetricsService를 모듈 프로바이더로 추가 - 해당 메트릭 서비스들을 모듈 exports에 포함
- 이벤트 발행 성공, 실패, 상태 전이, 처리 시간, DLQ 발생을 메트릭으로 기록
- 메시지 소비 ACK/NACK, 인플라이트, 처리 시간 메트릭을 기록 - ES 작업 타입(index/update/delete)별 성공, 실패와 처리 시간을 메트릭으로 확인, 동기화 이벤트도 카운트
mindaaaa
approved these changes
Feb 4, 2026
Collaborator
mindaaaa
left a comment
There was a problem hiding this comment.
우와 백엔드 모니터링에서는 별도 관측 서비스 레이어도 필요하군요!
코드 처음봐서 신기합니다!
서버 안에서 일어난 사건들을 다 이어지게 관측할 수 있어서 좋아보이네요👀
peanut990
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 관련 이슈
closed: #313
✅ PR 체크리스트(최소요구조건)
[ ] 테스트 작성했다.
✨ 작업 개요
Prometheus와 Grafana 기반 모니터링 시스템을 구축하여 API, Outbox, RabbitMQ, Elasticsearch 전 영역에서 성능 지표를 수집
🧹 작업 상세 내용
1. Prometheus 모니터링 기반 구축
파일
metrics.constants.ts- API, Outbox, RabbitMQ, ES 메트릭 이름 상수 정의metrics.provider.ts- Counter, Histogram, Gauge 프로바이더 통합 정의api-metrics.service.ts- HTTP 요청 횟수 및 응답 시간 메트릭 기록outbox-metrics.service.ts- Outbox 이벤트 발행, 상태 전이, DLQ 메트릭 기록rabbitmq-metrics.service.ts- 메시지 publish/consumer, 인플라이트 메트릭 기록elasticsearch-metrics.service.ts- ES 작업(index/update/delete) 성공/실패 및 성능 메트릭 기록메트릭 정의
2. 응답 변환 및 메트릭 수집 인터셉터
response-transform.interceptor.ts-/metrics엔드포인트 예외 처리로 순환 문제 방지api-metrics.interceptor.ts- 전역 인터셉터로 모든 HTTP 요청 메트릭 자동 수집📸 스크린샷 (선택)
서버 리소스
API 성능
Elasticsearch 동기화 모니터링
🔍 고민 지점
[ 첫 번째 고민 ]
[ 두 번째 고민 ]
💬 기타 참고 사항
알림 시스템이나 DB 같은 것에 아직 모니터링을 붙이지 못했어요...!
일단 먼저 해야하는 것 (동기화 부분 장소 address) 처리 한 후 이어서 해볼예정이에요.
또한, 아직 인프라를 고려하지 않은 PR이라 머지후 dev, prod 환경에서도 모니터링을 확인할 수 있도록 좀 더 살펴본 후 PR에 내용을 추가하고자 해요 (다시 말씀드릴게요!)