Skip to content

[Observability] 비동기 Queue 운영 상태 Gauge와 정체 경보 추가 - #336

Merged
Gimini-3 merged 1 commit into
developfrom
feature/334-async-queue-operational-gauges
Sep 13, 2026
Merged

Gimini-3 merged 1 commit into
developfrom
feature/334-async-queue-operational-gauges

Conversation

@Gimini-3

Copy link
Copy Markdown
Contributor

문제와 결과

상태 전이 Counter만으로는 지금 Queue가 쌓였는지, Worker가 사라졌는지, 오래 PROCESSING에 머문 작업이 있는지 알 수 없었습니다. 전체 PENDING 수는 미래 Retry까지 포함하고, scrape 때마다 DB를 조회하면 감시 트래픽이 DB 부하를 늘립니다.

이 변경은 기본 15초마다 전용 단일 Thread에서 Queue별 aggregate SQL 3개를 실행해 마지막 정상 Snapshot을 원자적으로 교체합니다. /actuator/prometheus의 9개 Queue·Worker Gauge와 Snapshot freshness Gauge는 메모리만 읽으므로 scrape당 DB 조회는 0회입니다.

변경 내용

  • Embedding의 현재 claim 가능 수, PROCESSING 수, oldest eligible age, 유효 Worker 수 추가
  • RAG PROCESSING 수와 oldest processing age 추가
  • Sync Outbox의 현재 claim 가능 수, PROCESSING 수, oldest eligible age 추가
  • next_retry_at·available_at이 미래인 backoff 항목을 backlog에서 제외
  • 2초 read-only Transaction과 전용 Scheduler로 3개 aggregate SQL만 주기 실행
  • 일부 Query 실패 시 마지막 정상 Snapshot 보존
  • Snapshot age와 refresh_total{outcome="success|failed"}로 수집 실패 노출
  • 다중 Backend의 동일 DB Gauge를 max by (cluster, environment)로 평가하는 정체 경보 5개 추가

검증

  • Backend 전체 테스트: 1171개 통과, 실패 0, errors 0, skipped 0
  • 실제 PostgreSQL에서 future backoff 제외, oldest 기준, PROCESSING 수, Worker Heartbeat 경계 검증
  • 반복 Gauge scrape에서 QueryService 호출 0회 검증
  • 실패 시 마지막 정상값 보존과 첫 성공 전 snapshot_age=+Inf 검증
  • 실제 /actuator/prometheus에서 Queue·Worker Gauge 9개, freshness Gauge와 refresh Counter 노출 확인
  • promtool check config: 성공, rule file 3개·총 19개 규칙
  • Backend·Pipeline·Operational rule suite: 모두 성공
  • 기본·monitoring profile docker compose config --quiet: 성공
  • git diff --check: 성공

Closes #334

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d1b0aad2-6679-4641-adac-f6e5295991d1


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.

@Gimini-3
Gimini-3 requested a lite review from Copilot September 13, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Gimini-3
Gimini-3 merged commit dd4f76c into develop Sep 13, 2026
1 check passed
@Gimini-3
Gimini-3 deleted the feature/334-async-queue-operational-gauges branch September 13, 2026 10:45
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.

[Observability] 비동기 Queue 운영 상태 Gauge와 정체 경보 추가

2 participants