Search

Chapter 2. Archive JFR recordings

download PDF

You can archive active JFR recordings to avoid potential data loss from JFR recordings. You can download or upload the archived JFR recording, so that you can analyze the recording to suits your needs.

You can find archived JFR recordings from the Archives menu in chronological order under one of three headings: All Targets, All Archives, and Uploads. Depending on what actions you performed on a JFR recording, the recording might display under each table.

2.1. Archiving JDK Flight Recorder (JFR) recordings

You can archive active JFR recordings to avoid potential data loss from JFR recordings. Data loss might occur when Cryostat replaces legacy JFR recording data with new data to save storage space or when a target JVM abruptly stops or restarts.

When you create an archived recording, Cryostat copies the active JFR recording’s data and stores the data in a persistent storage location on your Cryostat instance. The Red Hat build of Cryostat Operator builds this persistent storage location onto the associated persistent volume claim (PVC) on the Red Hat OpenShift cluster.

You can archive any JFR recording, regardless of its configuration. Additionally, you can archive snapshots from a JFR recording.

Prerequisites

  • Entered your authentication details for your Cryostat instance.
  • Created a target JVM recording and entered your authenticated details to access the Recordings menu. See Creating a JDK Flight Recorder (JFR) recording (Creating a JFR recording with Cryostat).

Procedure

  1. On the Active Recordings tab, select the checkbox for your JFR recording. The Archive button is activated in the Active Recordings toolbar.

    Figure 2.1. Archive button for your JFR recording

    Archive button for your JFR recording
  2. Click the Archive button. Cryostat creates an archived recording of your JFR recording.

    You can view your archived recording from under the Archived Recordings tab along with any other recording that relates to your selected target JVM.

    Alternatively, you can view your archived recording from under the All Targets table.

    Figure 2.2. Example of a listed target JVM application that is under the All Targets table

    Example of a listed target JVM application that is under the *All Targets* table
    Tip

    To remove a target JVM entry that does not have an archived recording, select the Hide targets with zero recordings checkbox.

    After you click on the twistie (v) beside the JVM target entry, you can access a filter function, where you can edit labels to enhance your filter or click the Delete button to remove the filter.

  3. From the All Targets table, select the checkbox beside each target JVM application that you want to review. The table lists each archived recording and its source location.
  4. Go to the All Archives table. This table looks similar to the All Targets table, but the All Archives table lists target JVM applications from files that Cryostat archived inside Cryostat.

    Note

    If an archived file has no recognizable JVM applications, it is still listed on the All Archives table but opens within a nested table under the heading lost.

  5. Optional: To delete an archived recording, select the checkbox next to the specific archived JFR recording item, and click Delete when prompted.

    Figure 2.3. Deleting an archived JFR recording

    Deleting an archived JFR recording
    Note

    Cryostat assigns names to archived recordings based on the address of the target JVM’s application, the name of the active recording, and the timestamp of the created archived recordings.

2.2. Downloading an active recording or an archived recording

You can use Cryostat to download an active recording or an archived recording to your local system.

Prerequisites

Procedure

  1. Navigate to the Recordings menu or the Archives menu on your Cryostat instance.

    Note

    The remaining steps use the Recordings menu as an example, but you can follow similar steps on the Archives menu.

  2. Determine the recording you want by clicking either the Active Recordings tab or the Archived Recordings tab.
  3. Locate your listed JFR recording and then select its overflow menu.

    Figure 2.4. Viewing a JFR recording’s overflow menu

    Viewing a JFR recording’s overflow menu
  4. Choose one of the following options:

    1. From the overflow menu, click Download Recording. Depending on how you configured your operating system, a file-save dialog opens. Save the JFR binary file and the JSON file to your preferred location.
    2. From the All Targets table, select the overflow menu for your listed JFR recordings. Click Download to save the archived file along with its JSON file, which contains metadata and label information, to your local system.
  5. Optional: View the downloaded file with the Java Mission Control (JMC) desktop application.

    Note

    If you do not want to download the .jfr file, but instead want to view the data from your recording on the Cryostat application, you can click the View in Grafana option.

2.3. Uploading a JFR recording to the Cryostat archives location

You can upload a JFR recording from your local system to the archives location of your Cryostat.

To save Cryostat storage space, you might have scaled down or removed your JFR recording. If you downloaded a JFR recording, you can upload it to your Cryostat instance when you scale up or redeploy the instance.

Additionally, you can upload a file from a previous Cryostat instance to a new Cryostat instance. Cryostat analysis tools work on the recording uploaded to the new Cryostat instance.

Prerequisites

Procedure

  1. Go to the Archives menu on your Cryostat instance.

    Figure 2.5. Archives menu on the Cryostat web console

    *Archives* menu on the Cryostat web console
  2. Optional: From the Uploads table, you can view all of your uploaded JFR recordings. The Uploads table also includes a filtering mechanism similar to other tables, such as the All Targets table, and other output. You can also use the filtering mechanism on the Archives menu to find an archived file that might have no recognizable target JVM application.

    Figure 2.6. The Uploads table in the Archives menu

    The *Uploads* table in the *Archives* menu
  3. Click the upload icon. A Re-Upload Archived Recording window opens in your Cryostat web console:

    Figure 2.7. Re-Upload Archived Recording window

    *Re-Upload Archived Recording* window
  4. In the JFR File field, click Upload.
  5. Locate the JFR recording files, which are files with a .jfr extension, and then click Submit.

    Note

    Alternatively, you can drag and drop .jfr files into the JFR File field.

Your JFR recording files open in the Uploads table.

Figure 2.8. Example of a JFR recording that is in the Uploads table

Example of a JFR recording that is in the *Uploads* table
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.