Skip to content

Repository 호출·소요시간 패널 추가 - #942

Merged
m-a-king merged 2 commits into
devfrom
infra/939-repository-panels
Aug 14, 2026
Merged

Repository 호출·소요시간 패널 추가#942
m-a-king merged 2 commits into
devfrom
infra/939-repository-panels

Conversation

@m-a-king

@m-a-king m-a-king commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Situation

  • 메트릭 한도 초과를 조사하다(메트릭 한도 초과 해소 - 카디널리티 누수 차단과 수집 주기 조정 infra#42) spring_data_repository_invocations_seconds_*384 시리즈를 쓰면서 대시보드·알림 어디에서도 참조가 0건인 것이 드러났다.
  • 처음엔 감축 대상이었다. 다만 이 지표는 트레이스가 못 하는 일을 한다: JDBC 스팬은 단건 맥락(이 요청에서 어떤 쿼리가 돌았나)을 보여주지만 추세(어느 조회가 갑자기 늘었나·느려졌나)는 못 본다. 지우는 대신 뷰에 올려 값어치를 쓰는 쪽으로 방향을 바꿨다.

Task

  • 이미 수집 중인 repository 지표를 대시보드에 올려, 트레이스와 역할이 겹치지 않는 자리(추세)를 채운다.

Action

의존성 row(HikariCP 옆)에 패널 2개를 추가했다.

패널 쿼리 단위
Repository 호출률 sum by (repository) (rate(..._count[$__rate_interval])) req/s
Repository 평균 소요시간 sum by (repository) (rate(..._sum[...])) / 같은 그룹의 _count s

설계를 한 번 뒤집은 이유 (topk 함정)

처음엔 topk(10, ...) + repository·method 단위로 만들었다. 라이브에 반영해 눈으로 확인하니 범례가 40개 넘게 불어나 그래프를 덮었다.

원인은 topk 의 성질이다 — range 조회에서 topk 는 시점마다 상위 10개를 다시 고르므로, 6시간 구간에서는 그동안 한 번이라도 순위에 든 시리즈가 전부 범례에 누적된다. method 단위는 48개 조합이라 특히 심했다.

repository 단위로 바꾸니 17개로 고정되어 topk 자체가 불필요해졌고, 범례가 안정적이며 시점별 변동도 사라졌다. 메서드 단위 상세가 필요하면 트레이스로 내려가면 되므로 잃는 것도 없다.

배치

의존성 row 안 새 줄(y=32)에 좌우 반반(w=12)으로 넣고, 그 아래 패널들의 y 를 4씩 내렸다. 좌표 중복이 없음을 스크립트로 확인했다.

Result

  • 라이브에 반영해 prod 에서 두 패널 모두 데이터 렌더를 확인했다(19 시리즈·181 포인트). JSON 정본과 라이브가 같은 상태다.
  • 데이터소스 timeInterval 이 이미 60s 로 잡혀 있어, 수집 주기를 60초로 바꾸는 변경(메트릭 카디널리티 누수 차단과 수집 주기 60s 조정 infra#44)과도 정합이다. 대시보드의 rate 창은 전부 $__rate_interval 이라 하드코딩된 창이 없다.
  • 384 시리즈가 "수집만 되고 아무도 안 보는 것"에서 "추세를 보는 뷰"로 바뀌었다.

연관 이슈

Summary by CodeRabbit

  • 새로운 기능
    • Grafana 대시보드에 Repository 호출률과 평균 응답 시간 패널을 추가했습니다.
    • 리소스, 로그, 파싱·추출 관련 관측 섹션의 배치를 새 패널에 맞게 조정했습니다.

- 메트릭 한도 조사(TeamPiKi/infra#42)에서 spring_data_repository 지표가 384 시리즈를 쓰면서 대시보드·알림 참조가 0건인 것이 드러났다. 지우는 대신 뷰에 올려 값어치를 쓰는 쪽을 택했다
- 역할 분담: 트레이스의 JDBC 스팬은 단건 맥락을, 이 패널은 추세를 본다("어느 조회가 갑자기 늘었나·느려졌나")
- 처음엔 topk(10) + repository·method 단위로 만들었으나 라이브 확인에서 범례가 40개 넘게 불어났다. topk 는 시점마다 상위를 다시 고르므로 range 조회에서는 그동안 순위에 들어온 시리즈가 범례에 누적된다. repository 단위(17개 고정)로 바꿔 topk 자체를 걷어냈다
- 의존성 row 에 배치(HikariCP 옆). 그 아래 패널들의 y 를 4씩 내렸다
- 검증: 라이브 반영 후 prod 에서 두 패널 모두 데이터 렌더 확인(19 시리즈·181 포인트). 데이터소스 timeInterval 이 이미 60s 라 $__rate_interval 이 수집 주기 60s 전환과도 정합
@m-a-king m-a-king added the infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow) label Aug 13, 2026
@m-a-king m-a-king self-assigned this Aug 13, 2026
@m-a-king m-a-king added the infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow) label Aug 13, 2026
@github-actions

Copy link
Copy Markdown

Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: d2c1077b-25c0-4d85-a3ce-d5e5e53ef1e4

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8389d and 110411c.

📒 Files selected for processing (1)
  • infra/grafana/dashboard.json

Walkthrough

Grafana 대시보드에 Repository별 호출률과 평균 소요시간 패널을 추가했습니다. 기존 리소스, 로그, 파싱·추출 관측 패널의 세로 위치를 새 패널에 맞게 조정했습니다.

Changes

Repository 관측 대시보드

Layer / File(s) Summary
Repository 메트릭 패널 추가
infra/grafana/dashboard.json
Repository별 호출률과 평균 소요시간을 Prometheus 메트릭으로 표시하는 timeseries 패널 2개를 추가했습니다.
기존 패널 레이아웃 조정
infra/grafana/dashboard.json
리소스, 로그, 파싱·추출 관측 패널의 gridPos.y 값을 새 패널 위치에 맞게 조정했습니다. 대시보드 JSON의 최종 구조도 유지했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 11041

This PR adds repository call-rate and average-duration panels to the dashboard without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.

연결 이슈 검증

Objective Addressed Explanation
[#939] 의존성 row에 Repository 호출률 및 평균 소요시간 패널 추가
[#939] 호출률을 topk(10, sum by (repository, method) (rate(...)))로 집계하고 $environment 변수를 사용 제공된 변경 요약에는 topk(10) 적용과 $environment 필터 사용 여부가 명시되지 않았습니다.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch infra/939-repository-panels

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.

@m-a-king
m-a-king merged commit eb0cb1d into dev Aug 14, 2026
7 checks passed
@m-a-king
m-a-king deleted the infra/939-repository-panels branch August 14, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repository 호출·소요시간 패널 추가 (수집 중이나 미사용이던 지표 활용)

1 participant