From 110411cc3f45263121a2af40014d9e1dfa92317d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=9E=AC=EC=A4=91?= <126754298+m-a-king@users.noreply.github.com> Date: Thu, 13 Aug 2026 20:50:49 +0900 Subject: [PATCH] =?UTF-8?q?infra:=20Repository=20=ED=98=B8=EC=B6=9C=C2=B7?= =?UTF-8?q?=EC=86=8C=EC=9A=94=EC=8B=9C=EA=B0=84=20=ED=8C=A8=EB=84=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 메트릭 한도 조사(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 전환과도 정합 --- infra/grafana/dashboard.json | 120 +++++++++++++++++++++++++++++++---- 1 file changed, 107 insertions(+), 13 deletions(-) diff --git a/infra/grafana/dashboard.json b/infra/grafana/dashboard.json index 22e2b186..8c46efe1 100644 --- a/infra/grafana/dashboard.json +++ b/infra/grafana/dashboard.json @@ -1238,6 +1238,100 @@ } ] }, + { + "id": 205, + "type": "timeseries", + "title": "Repository 호출률", + "description": "Spring Data repository 별 초당 호출 수. 트레이스(JDBC 스팬)가 단건 맥락을 보여준다면 이 패널은 추세를 본다 - 어느 조회가 갑자기 늘었는지. method 까지 쪼개지 않는 이유: repository 는 17개로 고정이라 범례가 안정적인 반면, method 단위(48개)는 topk 로 잘라도 시점마다 상위 구성이 바뀌어 범례가 계속 불어난다. 메서드 단위 상세는 트레이스로 내려가 본다.", + "gridPos": { + "h": 4, + "w": 12, + "x": 0, + "y": 32 + }, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROM}" + }, + "fieldConfig": { + "defaults": { + "unit": "reqps", + "custom": { + "drawStyle": "line", + "fillOpacity": 10, + "showPoints": "never" + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "refId": "A", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROM}" + }, + "expr": "sum by (repository) (rate(spring_data_repository_invocations_seconds_count{application=\"piki-core\", environment=\"$environment\"}[$__rate_interval]))", + "legendFormat": "{{repository}}" + } + ] + }, + { + "id": 206, + "type": "timeseries", + "title": "Repository 평균 소요시간", + "description": "repository 별 평균 소요시간(sum/count). 특정 조회가 느려지는 추세를 잡는다. 단건 원인은 트레이스의 piki-db 스팬으로 내려가 확인한다.", + "gridPos": { + "h": 4, + "w": 12, + "x": 12, + "y": 32 + }, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROM}" + }, + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "drawStyle": "line", + "fillOpacity": 10, + "showPoints": "never" + } + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "refId": "A", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROM}" + }, + "expr": "sum by (repository) (rate(spring_data_repository_invocations_seconds_sum{application=\"piki-core\", environment=\"$environment\"}[$__rate_interval])) / sum by (repository) (rate(spring_data_repository_invocations_seconds_count{application=\"piki-core\", environment=\"$environment\"}[$__rate_interval]))", + "legendFormat": "{{repository}}" + } + ] + }, { "id": 105, "type": "row", @@ -1246,7 +1340,7 @@ "h": 1, "w": 24, "x": 0, - "y": 32 + "y": 36 } }, { @@ -1257,7 +1351,7 @@ "h": 4, "w": 8, "x": 0, - "y": 33 + "y": 37 }, "datasource": { "type": "prometheus", @@ -1314,7 +1408,7 @@ "h": 4, "w": 8, "x": 8, - "y": 33 + "y": 37 }, "datasource": { "type": "prometheus", @@ -1360,7 +1454,7 @@ "h": 4, "w": 8, "x": 16, - "y": 33 + "y": 37 }, "datasource": { "type": "prometheus", @@ -1408,7 +1502,7 @@ "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 41 } }, { @@ -1420,7 +1514,7 @@ "h": 4, "w": 24, "x": 0, - "y": 38 + "y": 42 }, "datasource": { "type": "loki", @@ -1453,7 +1547,7 @@ "h": 4, "w": 24, "x": 0, - "y": 42 + "y": 46 }, "datasource": { "type": "loki", @@ -1486,7 +1580,7 @@ "h": 1, "w": 24, "x": 0, - "y": 47 + "y": 51 } }, { @@ -1498,7 +1592,7 @@ "h": 8, "w": 8, "x": 0, - "y": 48 + "y": 52 }, "datasource": { "type": "prometheus", @@ -1563,7 +1657,7 @@ "h": 8, "w": 8, "x": 8, - "y": 48 + "y": 52 }, "datasource": { "type": "loki", @@ -1644,7 +1738,7 @@ "h": 8, "w": 8, "x": 16, - "y": 48 + "y": 52 }, "datasource": { "type": "loki", @@ -1694,7 +1788,7 @@ "h": 9, "w": 24, "x": 0, - "y": 56 + "y": 60 }, "datasource": { "type": "loki", @@ -1728,4 +1822,4 @@ ] } ] -} \ No newline at end of file +}