Skip to content

otel.proofer.tech/{tenant} 대시보드, Sign in with Vercel 로그인 - #49

Merged
hsol merged 3 commits into
mainfrom
feat/otel-dashboard
Nov 14, 2026
Merged

hsol merged 3 commits into
mainfrom
feat/otel-dashboard

Conversation

@hsol

@hsol hsol commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

#48 위에 쌓은 PR 이다. #48 머지 후 base 를 main 으로 바꾼다.

무엇을

otel.proofer.tech/{tenant} 에 테넌트별 대시보드를 단다. 로그인은 Sign in with Vercel 이고, Vercel 팀 멤버만 자기 팀 테넌트 대시보드를 본다. proofer 팀은 /proofer, hsol 팀은 /hsol.

팀과 테넌트를 어떻게 맞추나

Sign in with Vercel 의 팀 권한(Team Read)은 아직 private beta 라 일반 앱은 로그인한 사람의 신원만 받는다. 그래서 테넌트마다 그 팀이 소유한 앱을 하나씩 둔다.

  • 각 팀이 Settings > Apps 에서 앱을 만들고 Sign-In Access 를 Members of the team 으로 둔다. 팀 멤버가 아니면 Vercel 이 access_denied 로 돌려보낸다
  • otel_tenant.vercel_client_id 로 테넌트와 앱을 잇는다. 콜백에서 ID 토큰 서명(JWKS), iss, aud(= 그 테넌트 앱), exp, nonce 를 검사한 뒤 그 테넌트 세션만 발급한다
  • PKCE(S256) + state + nonce. 세션과 OAuth 임시값은 HMAC 서명 쿠키(OTEL_SESSION_SECRET)
  • 쿠키를 테넌트별로 두어 두 팀에 다 속한 사람은 두 대시보드를 동시에 쓸 수 있다
  • 베타가 열리면 앱 하나로 합칠 수 있게 vercel_team_id 컬럼을 같이 둔다

경로

경로 내용
/{tenant} 로그인 전: Vercel 로그인 버튼. 로그인 후: 대시보드
/{tenant}?days=7|30|90 기간
/{tenant}/p/{promptId} 프롬프트 하나가 일으킨 이벤트 타임라인
/{tenant}/auth/login, /auth/callback, /auth/logout 인증
/{tenant}/v1/{logs,traces,metrics} 수신. 토큰의 테넌트와 경로가 다르면 401
/ 안내 문구만. 테넌트 목록은 노출하지 않음

v1, auth, api, health 는 slug 로 쓸 수 없다.

대시보드 구성

예상 비용, 프롬프트, 세션, 사용자, 토큰, 툴 실행과 실패율, API 에러 / 일별 비용과 프롬프트 차트 / 사용자별, 모델별, 툴별 표 / 최근 프롬프트 / service.name x 이벤트 분포(Office Agents 처럼 형식을 모르는 출처 확인용). 모든 쿼리는 tenant_id 로 먼저 거른다.

배포 후 설정

환경변수

  • OTEL_SESSION_SECRET: 32자 이상 임의 문자열
  • OTEL_VERCEL_APPS: {"<proofer 앱 client id>":"<secret>","<hsol 앱 client id>":"<secret>"}
  • (선택) OTEL_PUBLIC_ORIGIN: https://otel.proofer.tech

팀별 Vercel 앱

  1. 팀 Settings > Apps > Create
  2. Authorization Callback URL: https://otel.proofer.tech/{tenant}/auth/callback
  3. Permissions: openid, email, profile
  4. Sign-In Access: Members of the team
  5. client secret 발급 후 위 환경변수에 추가

테넌트 연결

pnpm db:migrate
pnpm tsx database/scripts/otel-tenant.ts hsol "hsol"          # 새 테넌트 + 수신 토큰
pnpm tsx database/scripts/otel-tenant.ts proofer --vercel-client-id cl_xxx --vercel-team-id team_xxx
pnpm tsx database/scripts/otel-tenant.ts hsol --vercel-client-id cl_yyy

검증

  • tsc --noEmit, eslint 통과
  • jest 13건 통과: 세션 서명/위조/만료, ID 토큰 서명/aud/nonce/만료 (실제 RSA 키로 서명해 검증)
  • 실제 Vercel 로그인과 대시보드 렌더는 앱 생성 후 프리뷰에서 확인 필요
  • Lint & Typecheck 체크는 main 의 docs/sism-home/motion.js 때문에 실패 중 (otel.proofer.tech 테넌트별 OTLP 수신구 #48 코멘트 참조)

Generated by Claude Code

Cowork 와 Office Agents 의 OTel 이벤트를 받는다. 테넌트마다 Bearer 토큰 하나를
두고 sha256 해시로만 저장한다. logs 는 logRecord 한 건을 otel_log_record 한 행으로
펼치고, traces / metrics 와 해석되지 않은 배치는 otel_raw_batch 에 원문으로 남긴다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn
테넌트마다 그 팀이 소유한 Sign in with Vercel 앱을 하나씩 연결한다. 앱의 Sign-In Access 를
팀 멤버로 제한해 두면 로그인 성공이 곧 팀 멤버라는 증명이 되고, 콜백에서 ID 토큰의 aud 로
테넌트를 확정한다. 세션 쿠키는 테넌트별로 따로 둔다.

수신 경로도 /{tenant}/v1/{signal} 을 추가하고, 토큰의 테넌트와 경로의 테넌트가 다르면 401 을 낸다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
proofer Ready Ready Preview Nov 14, 2026 3:05pm UTC

Request Review

hsol commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Lint & Typecheck 실패는 #48 과 같은 원인입니다. main 의 docs/sism-home/motion.js:56 미사용 상수 EASE_OUT 하나뿐이고, 이 PR 이 바꾼 파일에서는 에러가 나지 않습니다(로컬 tsc --noEmit, eslint, jest 13건 통과). 자세한 내용은 #48 코멘트 참조.


Generated by Claude Code

Base automatically changed from feat/otel-ingest to main November 14, 2026 15:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn
@hsol
hsol merged commit 98fa01b into main Nov 14, 2026
4 of 6 checks passed
@hsol
hsol deleted the feat/otel-dashboard branch November 14, 2026 15:05
hsol added a commit that referenced this pull request Nov 14, 2026
## 무엇을

1. **main 의 `Lint & Typecheck` 를 다시 통과시킨다.**
`docs/sism-home/motion.js:56` 의 미사용 상수 `EASE_OUT` 하나가 eslint 에러(1
error)로 CI 를 막고 있었다. #48, #49, #50 이 모두 이것 때문에 빨간 체크로 머지됐다.
2. **#43 을 대체한다.** dependabot #43 은 `package-lock.json` 기준으로 만들어져 레포가
pnpm 으로 옮긴 뒤 충돌(dirty) 상태다. 같은 업데이트를 pnpm 으로 적용한다.
   - `next` 16.0.8 -> **16.0.11** (#43 은 16.0.10. 16.0.x 안에서 최신 패치로 올림)
- `@tiptap/extension-link` 지정 범위 `^2.2.4` -> `^2.27.1` (lock 은 이미 2.27.2
로 풀려 있어 설치 버전은 그대로)

## 검증 (CI 와 같은 순서로 로컬 실행)

- `pnpm run prettier:check` 통과
- `pnpm exec eslint .` 0 errors (경고 8건은 기존)
- `pnpm run lint:stylelint` 통과
- `pnpm run typecheck` 통과
- `pnpm run jest` 20 suites / 153 tests 통과

머지 후 #43 은 닫는다.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn)_

Co-authored-by: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 7ea6a3f7 Deployed Nov 14, 2026 by vercel[bot]
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.

2 participants