feat(apiserver,auth): API 계층 — 질의를 promql 로, /rules·/alerts 신설 - #14
Merged
Conversation
demo.go(372줄)는 가져오지 않았다. 데모가 제품을 잠식한 것이 재구축 이유이고, 그 코드는 아카이브된 저장소에 남아 있다. webui 배선도 프론트 이관 전까지 뺐다. - **질의를 promql 엔진으로 교체.** 프로토타입의 handleQuery 는 parseSelector 로 이름·라벨 매처만 팠다 — sum(x)·increase(x[5m]) 이 이제 통한다. - **/api/v1/rules·/alerts 신설.** Prometheus 스키마 그대로라 기존 도구가 붙는다. 룰 매니저가 없어도 빈 **배열**을 낸다(null 이 나가면 프론트가 깨진다). - NewServer 는 옵션 함수 대신 Deps 구조체를 받는다 — 필드가 늘 때 호출부가 무엇을 넘기는지 한눈에 보인다. - 데이터 경로는 전부 인증을 지난다. 실 클러스터 메트릭은 노드 이름·디바이스 시리얼까지 담고 있어 익명 열람 대상이 아니다.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
eightynine01
added a commit
that referenced
this pull request
Aug 12, 2026
TestRecoversBeforeExhausting 이 20ms 뒤 서버를 성공으로 바꿨는데, 백오프 합계(1+2+4+8ms)가 그보다 짧아 빠른 환경에서는 재시도가 먼저 소진됐다. 로컬은 통과하고 CI 는 실패하는 전형적인 시간 경주다 — 실제로 #14 의 게이트가 이것 때문에 빨간불이었다. 성공 시점을 시간이 아니라 **호출 횟수**로 만든다(처음 두 번 실패, 세 번째 성공). 시도 횟수까지 단언해 '몇 번 만에 복구했는가' 도 고정한다. 로컬 8회 반복 + race 3회 통과 확인. Co-authored-by: phil <phil@keiailab.com>
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.
Phase 1 의 ② 입니다. 밖에서 질의하고 알림 상태를 볼 수 있게 됩니다.
가져오지 않은 것
demo.go372줄은 복사하지 않았습니다. 데모가 제품을 잠식한 것이 재구축 이유이고, 그 코드는 아카이브된 저장소에 그대로 있습니다.webui배선도 프론트 이관 전까지 뺐습니다.질의를 promql 로 교체
프로토타입의
handleQuery는parseSelector로 이름과 라벨 매처만 팠습니다. 이제sum(x)·increase(x[5m]) > 0이 통하고, 미지원 문법은 400 으로 거절합니다./api/v1/rules·/alertsPrometheus 스키마 그대로라 기존 도구가 붙습니다. 룰 매니저가 없어도 빈 배열을 냅니다 —
null이 나가면 프론트가 깨집니다.그 외
NewServer가 옵션 함수 대신Deps구조체를 받습니다 — 필드가 늘 때 호출부가 무엇을 넘기는지 한눈에 보입니다.검증
6개 테스트:
sum(x)=5 확인 / 미지원 문법 400 / 4개 데이터 경로 401 / healthz 공개 / 룰·알림 상태 스키마 / 매니저 없을 때 빈 배열.