Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(preset): add preset template and rule for Hibernate JFR #750

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andrewazores
Copy link
Member

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes: #736
See also #548
Depends on #749
Based on #749

Description of the change:

Adds a Preset Event Template for Hibernate JFR events, which are enabled by the hibernate-jfr dependency. Any application using Hibernate which also has this JAR on its classpath should have the relevant JFR event types registered, and they can be emitted simply by starting a recording with them enabled. Also adds an Automated Rule which detects the presence of these event types in the target JVM, for ease of enablement by the end user.

Motivation for the change:

Provides a quick and easy way for Cryostat + Hibernate users to get very detailed profiling information about the internals of their Hibernate sessions, transactions, etc. - simply install the hibernate-jfr dependency, redeploy the target application, and turn on the preset Automated Rule for Hibernate.

How to manually test:

  1. Check out and build PR
  2. ./smoketest.bash -O
  3. Open Web UI
  4. Go to Automated Rules view
  5. Enable the Hibernate rule
  6. An auto_hibernate recording should be started in Cryostat. Click around the UI a bunch to generate load, then download the recording. jfr print --events 'org.hibernate.orm.*' auto_hibernate.jfr should reveal lots of JFR data.

@github-actions github-actions bot added needs-triage Needs thorough attention from code reviewers dependent labels Dec 20, 2024
@andrewazores andrewazores added feat New feature or request safe-to-test and removed needs-triage Needs thorough attention from code reviewers labels Dec 20, 2024
@andrewazores andrewazores force-pushed the hibernate-jfr branch 2 times, most recently from 3e1c3ae to a9b39c2 Compare December 20, 2024 14:14
@andrewazores andrewazores marked this pull request as ready for review January 13, 2025 18:54
@andrewazores andrewazores requested a review from a team as a code owner January 13, 2025 18:54
Copy link

This PR/issue depends on:

@andrewazores andrewazores requested a review from a team January 13, 2025 18:54
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/13/2025, 1:54:56 PM. View Actions Run.

Copy link

No GraphQL schema changes detected.

Copy link

No OpenAPI schema changes detected.

Copy link

CI build and push: At least one test failed ❌
https://github.com/cryostatio/cryostat/actions/runs/12754082339

@andrewazores
Copy link
Member Author

Failure looks like hibernate/hibernate-orm#9180 . Checking if upgrading the hibernate-jfr dependency helps.

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/13/2025, 2:30:32 PM. View Actions Run.

Copy link

No GraphQL schema changes detected.

Copy link

No OpenAPI schema changes detected.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/12754629367

@@ -46,6 +46,7 @@
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.15.2</quarkus.platform.version>
<quarkus-quinoa.version>2.5.1</quarkus-quinoa.version>
<org.hibernate.orm.hibernate.jfr.version>6.6.4.Final</org.hibernate.orm.hibernate.jfr.version><!-- TODO is there some way to grab the Hibernate version used by Quarkus to match this version? -->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened a discussion about this here: quarkusio/quarkus#45552

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quarkus 3.15.2 with the Panache/Hibernate extension pulls in Hibernate 6.6.1, which I originally used in this PR to keep the Hibernate JFR version in sync. But, it runs into hibernate/hibernate-orm#9180 , so I upgraded to a later bugfix version to work around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request safe-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] Support Hibernate ORM JFR events
1 participant