Chapter 4. Labels for JFR recordings When you create a JDK Flight Recorder (JFR) recording on Cryostat 3.0, 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 When you create a JFR recording on Cryostat 3.0, 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 Recordings . Under the Active Recordings tab, click Create . On the Custom Flight Recording tab, expand Show metadata options . Note On 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 Enter values in the provided Key and Value fields. For example, if you want to file an issue with the recordings, you could enter the reason in the Key field and then enter the issue type in the Value field. Click Create to create your JFR recording. Your recording is then shown under the Active Recordings tab along with any specified recording labels and custom labels. Tip You can access archived JFR recordings from the Archives menu. See Uploading a JFR recording to Cryostat archives location (Using Cryostat to manage a JFR recording). Example The following example shows two default recording labels, template.name: Profiling and template.type: TARGET , and one custom label, reason:service-outage . 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 On the Cryostat web console, you can navigate to the 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 attach labels to this recording. Procedure On your Cryostat web console, click the Recording menu. From the Active Recordings tab, locate your JFR recording, and then select the checkbox to it. Click Edit Labels . An Edit Recording Label pane opens in your Cryostat web console, which you can use to add, edit, or delete labels for your JFR recording. Tip You can select multiple JFR recordings by selecting the checkbox that is 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. Optional : You can perform any of the following actions from the Edit Recording Labels pane: Click Add to create a label. Delete a label by clicking the X to the label. Edit a label by modifying any content in a field. After you edit content, a green tick is shown in the field to indicate an edit. Click Save . Optional : You can archive your JFR recordings along with their labels by completing the following steps: Select the checkbox to the recording's name. Click the Archive button. You can locate your recording under the Archived Recordings tab. 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. Note Cryostat preserves any labels with the recording for the lifetime of the archived recording. Verification From the Active Recordings tab, check that your changes display under the Labels section for your recording. Additional resources Archiving JDK Flight Recorder (JFR) recordings (Using Cryostat to manage a JFR recording) Revised on 2024-07-02 14:08:19 UTC

Commands: