Skip to content

hibernate 메트릭 수집 활성화 - #812

Merged
Cassiiopeia merged 1 commit into
mainfrom
20260731_#806_hibernate_메트릭_수집_활성화
Jul 31, 2026

Hidden character warning

The head ref may contain hidden characters: "20260731_#806_hibernate_\uba54\ud2b8\ub9ad_\uc218\uc9d1_\ud65c\uc131\ud654"
Merged

Cassiiopeia merged 1 commit into
mainfrom
20260731_#806_hibernate_메트릭_수집_활성화

Conversation

@Cassiiopeia

Copy link
Copy Markdown
Member

문제

PR #807에서 hibernate.generate_statistics: true를 추가했지만, 배포 후 운영에서 확인한 결과 hibernate_* 메트릭이 하나도 수집되지 않고 있었습니다.

관리자 인증 후 /actuator/prometheus → 200, 총 601개 지표
그중 hibernate_ 로 시작하는 지표: 0개

hikaricp_, jvm_, http_server_requests_ 등 나머지 지표는 정상이었습니다.

원인

Spring Boot 3.4.1의 HibernateMetricsAutoConfiguration 조건을 바이트코드로 확인했습니다.

@ConditionalOnClass({
    jakarta.persistence.EntityManagerFactory,
    org.hibernate.SessionFactory,
    org.hibernate.stat.HibernateMetrics,   ← 이것
    io.micrometer.core.instrument.MeterRegistry
})

org.hibernate.stat.HibernateMetrics는 Micrometer의 클래스(io.micrometer.core.instrument.binder.jpa.HibernateMetrics)가 아니라 Hibernate 쪽 hibernate-micrometer 아티팩트의 클래스입니다. 이 아티팩트는 hibernate-core에 포함되지 않는 별도 의존성이라 클래스패스에 없었고, 그 결과 auto-configuration 전체가 조용히 건너뛰어졌습니다.

generate_statistics: true만 켜둔 상태였으므로 통계 수집 비용은 지불하면서 지표는 얻지 못하는 상황이었습니다.

수정

RomRom-Web/build.gradleorg.hibernate.orm:hibernate-micrometer 추가. 버전은 Spring Boot BOM이 관리하며 hibernate-core와 동일한 6.6.4.Final로 해석됩니다.

검증

ConfigBindingTest에 실제 수집 여부를 단언하는 테스트를 추가했습니다. 실기동 통합 테스트라 관리자 인증 후 /actuator/prometheus 응답 본문을 직접 확인합니다.

뮤테이션 검증 수행: 의존성을 주석 처리하고 재실행하면 새 테스트만 정확히 실패합니다. 이 테스트가 실제로 회귀를 잡는다는 것을 확인했습니다.

의존성 있음 → ApplicationYamlStructureTest 12개 + ConfigBindingTest 7개 전부 통과
의존성 없음 → hibernate_지표가_수집된다 FAILED

배경

이 문제는 generate_statistics 설정만으로는 드러나지 않습니다. 설정은 정상 반영됐고(배포본 jar에서 확인), 라이브러리도 있었지만, auto-configuration의 조건 클래스 하나가 빠져 지표만 조용히 사라졌습니다. 배포 후 실제 메트릭 응답을 눈으로 확인하지 않았다면 발견하지 못했을 종류의 문제입니다.

@Cassiiopeia
Cassiiopeia merged commit c66d1e8 into main Jul 31, 2026
2 of 3 checks passed
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Cassiiopeia, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e2e9dd5-c01f-47b7-b0df-5dc8f369f4c7

📥 Commits

Reviewing files that changed from the base of the PR and between 86661cf and 16c9514.

📒 Files selected for processing (2)
  • RomRom-Web/build.gradle
  • RomRom-Web/src/test/java/com/romrom/web/config/ConfigBindingTest.java

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.

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