-
Here is how to activate JFR recordings for view thru Java Mission Control:
Tasks
- Enable JFR using
JAVA_TOOL_OPTIONS
in 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
.jfr
file: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.jar
Make requests to generate activity:
curl http://localhost:8080/api/issues curl http://localhost:8080/api/projects curl http://localhost:8080/api/users
Copy the file out:
docker cp <container-id>:/tmp/sztab.jfr ./sztab.jfr
What's in the
.jfr
file?- 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/jfr
endpoint 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
.jfr
recordings, and validate them using Java Mission Control (JMC). This sets the foundation for identifying performance bottlenecks and debugging concurrency issues.Tasks:
.jfr
recordings and open them in JMC.Estimated Time: 4–5 hours
.jfr
file via startup + traffic.jfr
with JMC and identify basic metricsGoal:
The project should support generating
.jfr
recordings that can be opened in Java Mission Control (JMC) to analyze performance characteristics and observability signals under load.