Sztab Observability: Integrate Java Flight Recorder (JFR) and demonstrate observability using JMC (SZ-7)
rk@tigase.net opened 4 hours ago

🧭 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:

  • Enable JFR via JVM options in Docker run or startup script.
  • Simulate representative load using curl/JMeter.
  • Collect .jfr recordings and open them in JMC.
  • Identify and document basic observability signals:
    • Hot methods
    • Lock contention
    • GC pauses
    • Allocation hotspots
  • Optional: Provide environment toggle to enable/disable JFR.

Estimated Time: 4–5 hours

TaskEstimated Time
Add JFR JVM options to Docker run script / startup~1 hour
Generate example .jfr file via startup + traffic~1 hour
Review .jfr with JMC and identify basic metrics~1 hour
Document usage (README or script)~1 hour
Optional: Add toggle for JFR-on/off via env var~30 mins

Goal:

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.

  • rk@tigase.net commented 4 hours ago

    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
issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Version
1
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-7
Please wait...
Page is in error, reload to recover