Skip to content

feat: 기존 Rocky 터널을 재사용한 읽기 전용 모니터 연동 - #81

Merged
SimYunSup merged 2 commits into
developfrom
feat/issue22-passive-monitor
Nov 14, 2026
Merged

SimYunSup merged 2 commits into
developfrom
feat/issue22-passive-monitor

Conversation

@SimYunSup

@SimYunSup SimYunSup commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

목적

Refs BCSDLab/bcsdpdevops#22

오류 수신 요약과 Rocky 읽기 전용 헬스를 분리해 대시보드에서 관측합니다. Rocky는 기존 koin-omp-gateway-rocky 터널과 OMP_GATEWAY VPC를 재사용합니다. 새 터널·공개 SSH·WARP/OpenBao 권한은 추가하지 않습니다.

변경

  • Worker GET /healthz: 전용 ERROR_MONITOR_TOKEN으로 기존 큐의 24시간 고유 오류 등록 건수·최근 신규 등록 시각·최근 10건을 SELECT만으로 조회합니다. GitHub PR 작업과 koin-api 기록은 제외합니다.
  • 리뷰 P2 수정: 소스별 건수·최근 등록 시각과 invalid 검사는 제한 없는 전체 기간에서 계산하고 최근 목록만 10건으로 제한합니다. 최근 10건 밖의 다른 소스가 0건으로 사라지지 않습니다.
  • Worker GET /healthz/rocky: 같은 수신 모니터 인증 후 기존 VPC의 고정 http://omp-gateway/healthz만 조회합니다. 별도 OMP_GATEWAY_MONITOR_TOKEN을 쓰고 모델·실행기·수신 모니터 토큰 재사용은 거부합니다.
  • 호스트 GET /healthz: uid 소유 0600 파일·0700 부모 디렉터리의 전용 모니터 토큰을 검증합니다. 모델 Bearer와 교차 사용 불가, 모델 처리 중에도 별도 2초 기한으로 동작합니다. 중단을 무시하는 수집기도 기한 초과로 닫힙니다.
  • CPU는 Linux /proc/stat 약 200ms 두 표본의 busy 비율(guest 중복 제외, idle+iowait 제외), RAM은 MemTotal − MemAvailable입니다. 읽기/시각/카운터 오류는 null이며 임의의 0으로 대체하지 않습니다.
  • 실행기·브로커는 고정 systemd 서비스의 설치/활성/MainPID·SubState 기반 프로세스 상태만 읽습니다. 브로커 HTTP 응답과 모델 실행은 not_probed입니다. 헬스 조회는 모델·claim·GitHub 작업을 시작하지 않습니다.
  • Basic 인증의 /api/automation이 두 경로를 병렬로 읽습니다. 최상위 수신 결과와 rocky 결과는 독립적이며 5초/16KiB·리다이렉트 거절·UTF-8·120초 신선도 검사를 적용합니다. 브라우저에 Bearer를 전달하지 않습니다.
  • 60초 관측 패널은 실패·오프라인·숨김·기한 초과를 미확인으로 표시하고 마지막 관측은 과거 기록으로 구분합니다. 오류 전문·로그·원본 provider ID·프롬프트·비밀은 반환하지 않습니다.

수행한 검증

  • 관련 queue/monitor/attendance consumer/gateway 행동 테스트 45개 통과
  • telemetry·error-automation·attendance 타입 검사 통과
  • 변경 소스 oxfmt 및 oxlint 통과, 두 Worker Wrangler dry-run 통과
  • 실제 로컬 workerd 두 개 + SQLite/KV + service binding + 실제 Node 게이트웨이 HTTP 연결에서 수신·호스트 응답 확인; 모델 호출 0회
  • 로컬 호스트는 macOS이므로 실제 CPU/RAM은 null/미측정이며 Linux 산식·systemd 해석은 결정적 fixture로 검증했습니다. 운영 Rocky 측정이나 터널 통과 증거로 주장하지 않습니다.
  • 로컬 게이트웨이 중단 시 수신 요약은 정상/실제 0건으로 유지되고 Rocky만 unknown/null, 화면은 마지막 호스트 관측으로 표시되는 동작 확인
  • 실제 브라우저 1280×720·1920×1080 무스크롤, 390px 가로 넘침 없음, 상세 대화상자와 page/console error 0 확인

운영 전제

  • 이 기능은 운영 배포하지 않았습니다. 정상 develop/main 승격 및 두 Worker 배포, Rocky 코드 반영과 전용 토큰 파일·유닛 drop-in 설정이 필요합니다.
  • ERROR_MONITOR_TOKEN은 attendance↔error-automation 사이에만, OMP_GATEWAY_MONITOR_TOKEN은 error-automation↔Rocky 사이에만 공유합니다. 모델·실행기 토큰은 그대로 유지합니다.
  • 기존 모델 슬롯/토큰/터널·운영 KV를 치환하거나 기존 DO/외부 오류 데이터를 초기화하지 않습니다. 실제 서비스 uid 확인과 모델 작업이 없는 승인된 작업 창에서 호스트를 반영해야 합니다.
  • 운영 Rocky 접속·전용 비밀 설정이 아직 확인되지 않았으므로 원격 CPU/RAM·브로커 응답·모델 성공을 정상으로 표시하지 않습니다.
  • 필수 리뷰를 우회하거나 자동 병합하지 않습니다. main 승격 PR #80은 feat: 기존 Rocky 터널을 재사용한 읽기 전용 모니터 연동 #81 병합 전까지 이 기능을 포함하지 않습니다.

전용 모니터 Bearer와 고정 Worker 바인딩으로 수신 요약만 조회한다.
고유 오류 등록 건수와 처리 상태만 반환하고 모델·잡 실행을 하지 않는다.
VPC·SSH·CPU/RAM 감시를 추가하지 않고 koin-api 기록을 제외한다.
오류·오래된 응답은 알 수 없음으로 표시하고 비밀값을 브라우저에 주지 않는다.

검증: 관련 패키지 3개 타입 검사, 오류 자동화 122개와 출근부 14개 테스트 통과.
oxlint와 두 Worker dry-run을 통과했다.
실제 로컬 두 Worker와 SQLite에서 정상 빈 조회·제공자 중단·복구를 확인했다.
1280x720·1920x1080 무스크롤 및 모바일 가로 넘침 없음을 확인했다.
운영 활성화는 main 승격과 별도 모니터 secret 설정 후에 수행한다.
@coderabbitai

coderabbitai Bot commented Nov 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bee9f7c-b213-4a48-8213-e8fb21114bee
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 4b64cf5 2026-11-14T00:30:04.322Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 28a0ce9 2026-11-13T14:40:38.371Z View logs ↗

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
koin-web 4b64cf5 Nov 14 2026, 12:30 AM

@bcsd-united-error-publisher

bcsd-united-error-publisher Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

자동 리뷰 결과 (claude-opus-5-5, 독립 검증)

  • 리뷰 head: 28a0ce9ccdbb635a2ea17f0613b58d496342fd7f
  • 발행 head: 28a0ce9ccdbb635a2ea17f0613b58d496342fd7f
  • base(develop): 72c16811d321551a0cbb37a14f7d54a08d0f3b96
  • manifest sha256: ad301433f67ec7108b54797ac5d7a61df8c92f62fa52ae631da3f49731576ac3
  • 판정: changes-requested (P1 0 / P2 1 / P3 0)

발견 사항

  • P2 apps/error-automation/src/queue.ts:315 — monitorSnapshot fills in per-source count/latestAt only from rows that survive LIMIT 10. If one source has 10 or more newer entries in the 24h window, the other source is reported as count 0 / latestAt null even though it has entries, and parseErrorMonitorSnapshot still accepts it. The dashboard then shows a real error feed as a quiet 0. Compute per-source totals in a separate aggregate query with no LIMIT, keep LIMIT 10 only for the recent list, and keep the invalid_count check. Blocked: apps/error-automation is outside the editable scope, so this was not fixed here.

적용된 수정

  • 없음 (리뷰 head 유지)

독립 검증 통과 항목

  • pr-head-pinned
  • native-fixture-tests
  • typecheck
  • autofix-security-tests
  • lint
  • build
  • runtime-route-smoke

주의

  • 리뷰 판정은 GitHub approval이 아닙니다. merge 여부는 아래 자동 merge 정책으로 별도 결정하며 main 승격과 배포는 수동입니다. PR 제목/본문/diff와 모델 출력은 신뢰할 수 없는 입력으로 취급했습니다.
  • 수정 커밋은 리뷰 head를 부모로 하는 fast-forward만 적용했으며 사람의 변경을 덮어쓰지 않습니다.

자동 merge

  • skipped: 리뷰가 승인되지 않았거나 P1/P2 발견 사항이 있습니다.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
koin-api 4b64cf5 Nov 14 2026, 12:30 AM

수신 집계는 최근 목록과 독립적으로 전체 24시간을 계산합니다.
Rocky 전용 Bearer와 고정 VPC healthz로 CPU·RAM·서비스 상태만 조회합니다.
모델 호출 없이 수신 요약과 호스트 장애를 분리합니다.
@SimYunSup SimYunSup changed the title feat: 오류 수신 요약을 읽기 전용 대시보드로 연동 feat: 기존 Rocky 터널을 재사용한 읽기 전용 모니터 연동 Nov 14, 2026
@SimYunSup

Copy link
Copy Markdown
Member Author

사용자의 명시적 강제 머지·배포 요청에 따라 필수 리뷰 대기만 관리자 예외로 우회합니다. 대상 head는 4b64cf582582d4cc7167b0a2d1e43c97c89d2548이며 현재 ESLint·Format·TypeCheck와 세 Workers Builds가 모두 성공했습니다. 로컬 45개 동작 테스트·HTTP 장애/복구·화면 검증도 완료했습니다. 운영 승격은 기존 main PR #80을 사용하며, Rocky 호스트 코드/전용 토큰 반영과 원격 실측은 별도 확인 전까지 미확인으로 유지합니다.

@SimYunSup
SimYunSup merged commit a2dba4e into develop Nov 14, 2026
7 checks passed
@SimYunSup

Copy link
Copy Markdown
Member Author

운영 반영 완료: #81·#80 및 운영 Pi 뷰어 보존 보완 #83·#84가 main 03e83c583d9d6ebb4e0aa6a5daab8818318cf4fe에 반영됐습니다. bcsd-attendance 활성 버전은 9ddd8bec-f1d2-4aa8-bbd9-9e6fc49253e2(100%)이며 기존 Access audience·VIEW_STATE namespace·device/Basic secret을 보존하고 전용 ERROR_MONITOR_TOKEN과 service binding만 추가했습니다. 실제 기존 Access 인증을 거친 운영 화면에서 /api/automation 200, ingress=ok, rocky=ok, gateway=responding, CPU/RAM 실측을 확인했습니다. 기존 터널을 통한 두 producer healthz도 200입니다. 브로커 HTTP·모델 생성은 계속 not_probed이며 새 접근 권한·인증 우회·원장 데이터 변경은 없습니다.

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.

1 participant