Chapter 4. Labels for JFR recordings
When you create a JDK Flight Recorder (JFR) recording on Cryostat, you can add metadata to the recording by specifying a series of key-value label pairs.
Additionally, you can attach custom labels to JFR recordings that are inside a target JVM, so that you can easily identify and better manage your JFR recordings.
The following list details some common recording label use cases:
- Attach metadata to your JFR recording.
- Perform batch operations on recordings that contain identical labels.
- Use labels when running queries on recordings.
You can use Cryostat to create a JFR recording that monitors the performance of your JVM in your containerized application. Additionally, you can take a snapshot of an active JFR recording to capture any collected data, up to a specific point in time, for your target JVM application.
4.1. Adding labels to JFR recordings Copy linkLink copied to clipboard!
When you create a JFR recording on Cryostat, you can use labels to add metadata that contain key-value label pairs to the recording.
Cryostat applies default recording labels to a created JFR recording. These default labels capture information about the event template that Cryostat used to create the JFR recording.
You can add custom labels to your JFR recording so that you can run specific queries that meet your needs, such as identifying specific JFR recordings or performing batch operations on recordings with the same applied labels.
Prerequisites
- Logged in to your Cryostat web console.
- Created or selected a target JVM for your Cryostat instance.
Procedure
- From your Cryostat web console, click Flight Recorder > Capture > Recordings.
- In the Recordings panel, click Create.
In the Custom Flight Recording tab, expand Show metadata options.
NoteIn the Custom Flight Recording tab, you must complete any mandatory field that is marked with an asterisk.
Click Add label.
Figure 4.1. The Add Label button that is displayed under the Custom Flight Recording tab
-
Click the key=value button and then use the text entry field to specify an appropriate key and value. For example, if you want to file an issue with the recordings, you could specify
reasonas the key and then specify an issue type as the value (for example,reason=service.outage). Ensure that you include an equals (=) sign between the specified reason and value. Click Create to create your JFR recording. Your recording is then shown in the Recordings panel along with any specified recording labels and custom labels.
TipYou can access archived JFR recordings from the Flight Recorder > Analyze > Archives menu. See "Uploading a JFR recording to the Cryostat archives location" in (Using Cryostat to manage a JFR recording).
Example
The following example shows one custom label, reason=service-outage, in addition to three default recording labels, template.name=Profiling, template.type=TARGET, and autoanalyze=true.
Figure 4.2. Example of an active recording with defined recording labels and a custom label
4.2. Editing a label for your JFR recording Copy linkLink copied to clipboard!
On the Cryostat web console, you can navigate to the Flight Recorder > Capture > Recordings menu and then edit a label and its metadata for your JFR recording. You can also edit the label and metadata for a JFR recording that you uploaded to archives.
Prerequisites
- Logged in to your Cryostat web console.
- Created a JFR recording and attached labels to this recording.
Procedure
- On your Cryostat web console, click the Flight Recorder > Capture > Recordings menu.
- In the Recordings panel, locate your JFR recording, and then select the checkbox next to it.
Click Edit Labels. An Edit labels pane opens in your Cryostat web console, which you can use to add, edit, or delete labels for your JFR recording.
TipYou can select multiple JFR recordings by selecting the checkbox that is next to each recording. Click the Edit Labels button if you want to bulk edit recordings that contain the same labels or add new identical labels to multiple recordings.
Figure 4.3. The Edit labels section that is displayed in the Recordings panel
Optional: You can perform any of the following actions from the Edit labels pane:
- Click Add label to create a label.
-
Delete a label by clicking the
xnext to the label. - Edit a label by modifying any content in a field.
- Click Save.
Optional: You can archive your JFR recordings along with their labels by completing the following steps:
- Select the checkbox next to the recording’s name.
Click the Archive button. You can locate your recording in the Flight Recorder > Analyze > Archives view.
By archiving your recording with its labels, you can enhance your search capabilities when you want to locate the recording at a later stage. You can also add additional labels to any recording that you uploaded to the Cryostat archives.
NoteCryostat preserves any labels with the recording for the lifetime of the archived recording.
Verification
- In the Flight Recorder > Capture > Recordings panel, check that your changes are displayed in the Labels column for your recording.
Revised on 2026-06-25 17:57:43 UTC