-
Here is how to activate JFR recordings for view thru Java Mission Control:
Tasks
- Enable JFR using
JAVA_TOOL_OPTIONSin your Dockerfile or Helm chart:JAVA_TOOL_OPTIONS="-XX:StartFlightRecording=filename=/tmp/sztab.jfr,duration=60s,settings=profile" - Record a 60-second trace and output to a temporary file inside the container (
/tmp/sztab.jfr) - Add script or instructions to extract the
.jfrfile:docker cp <container-id>:/tmp/sztab.jfr ./sztab.jfr - Ensure JVM runs with:
-XX:+FlightRecorder -XX:StartFlightRecording
Sample Usage
Start the app with:
java \ -XX:StartFlightRecording=filename=/tmp/sztab.jfr,duration=60s,settings=profile \ -jar app.jarMake requests to generate activity:
curl http://localhost:8080/api/issues curl http://localhost:8080/api/projects curl http://localhost:8080/api/usersCopy the file out:
docker cp <container-id>:/tmp/sztab.jfr ./sztab.jfr
What's in the
.jfrfile?- GC events
- Lock contention
- Method profiling
- Thread states and blocking
- Allocation hotspots
- Class loading and I/O metrics
We can inspect the recording using Java Mission Control (JMC)
Optional:
- Add
/actuator/jfrendpoint later (via Spring Actuator JFR plugin) - Integrate JFR recordings into CI-based performance regression suite
- Enable JFR using
-
| Type |
New Feature
|
| Priority |
Normal
|
| Assignee | |
| Version |
1
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
🧠Issue 7: Integrate Java Flight Recorder (JFR) and demonstrate observability using JMC
Description:
Enable and configure Java Flight Recorder (JFR) to capture observability data from the running Sztab application. Provide tooling or scripts to generate and collect
.jfrrecordings, and validate them using Java Mission Control (JMC). This sets the foundation for identifying performance bottlenecks and debugging concurrency issues.Tasks:
.jfrrecordings and open them in JMC.Estimated Time: 4–5 hours
.jfrfile via startup + traffic.jfrwith JMC and identify basic metricsGoal:
The project should support generating
.jfrrecordings that can be opened in Java Mission Control (JMC) to analyze performance characteristics and observability signals under load.