Chapter 2. New features Cryostat 2.2 introduces new features that enhance your use of the Cryostat product. Automatic archival of JFR recordings Cryostat 2.2 adds the Archive on Stop checkbox to the Recordings menu, so that you can configure Cryostat to automatically archive new JFR recordings to the persistent volume claim (PVC) storage location on Red Hat OpenShift. By default, Cryostat selects the Archive on Stop checkbox. If you select the Continuous checkbox, Cryostat clears the Archive on Stop checkbox. Additionally, you can issue a curl command in your CLI that requests Cryostat to automatically archive a single JFR recording to the PVC storage location on Red Hat OpenShift. The following example of a curl command specifies Cryostat to automatically archive any JFR recording file with a given name, duration, and event template. GraphQL API Cryostat 2.2 includes a GraphQL API endpoint, /api/v2.2/graphql , so that you can use the API to run shorter and simpler queries against target JVMs. You can also run these queries against any of a target JVM's active and archived recordings. The API can run queries against general Cryostat archives. You can then customize the queries to automate the following tasks for active or archived recordings: Archive Delete Start Stop Cryostat 2.2 introduces the following query capabilities: New filter options that apply to all query types. The GraphQL API can update JFR recording labels. Before Cryostat 2.2, you could only update a JFR recording's label by using the HTTP REST API, which has limited workload capabilities. The GraphQL API is more powerful than the HTTP REST API, which has limited workload capabilities. For example, the HTTP REST API would require you to create an API request for each copy of a recording that you want to start on each scaled replica that is inside a container on Red Hat OpenShift. The GraphQL API can achieve this task in one API request, which improves the API's performance and reduces any network traffic for your Cryostat instance. Cryostat 2.2 supports the HTTP REST API and includes some enhancements for this API, such as including new endpoints for downloading JFR files by using JWT tokens. However, this API requires more user intervention, such as requiring you to write custom clients to parse API JSON responses when performing iterative actions on response data. Pluggable Discovery API Cryostat supports the /api/v2.2/discovery endpoint, so you can use the Pluggable Discovery API to register external clients with Cryostat. The API can register or unregister a client based on Cryostat's environment. Note The Cryostat Operator on Red Hat OpenShift creates a service account for Cryostat. After you create an application on Red Hat OpenShift, the application can connect with Cryostat's Discovery Plugin API through the service account. You can disable Cryostat built-in target discovery mechanism, so that Cryostat uses the Discovery Plugin API as the primary target discovery mechanism. To disable Cryostat's built-in discovery mechanism, you would set the following environment variable to true : The Discovery Plugin API contains all the capabilities of Cryostat's built-in target discover mechanism. Permission mapping with ConfigMap You can now use create a ConfigMap resource that includes specific permissions from a properties file. The Cryostat Operator can then apply the permissions to your Cryostat instance. You no longer need to use the default permissions file that the Cryostat Operator mounts to Cryostat. Security context in a Cryostat CRD You can now specify security contexts for a Cryostat Custom Resource (CRD) on Red Hat OpenShift, so that you can configure your Cryostat Operator to better distribute Cryostat workloads across Red Hat OpenShift clusters. Before the Cryostat 2.2, the Cryostat Operator would use a default security context for Cryostat, which would limit permissions for your Cryostat Operator when distributing Cryostat workloads across Red Hat OpenShift clusters. Support for uploading automated rule definitions in JSON By uploading automated rule definitions in JSON, you can reuse a rule definition for your automated rule. This functionality is similar to how you would upload a recording to the Archives menu. From the Automated Rules menu on the Cryostat web console, you can now complete the following tasks: Configure a rule definition file with your preferred text editor or make additional copies of the file. Disable a rule definition, which prevents the rule from interacting with a JFR recording. You can enable the rule definition at a later stage. Download a rule definition file, such as continuous, in JSON format. Functionality is similar to how you would download a recording from the Recordings menu. Upload a rule definition in JSON format. By using this function, you can reuse a rule definition for your automated rule. Functionality is similar to how you would upload a recording to the Archives menu.

Commands:
curl --data "recordingName=foo2&duration=5&events=template=ALL&archiveOnStop=true" localhost:8181/api/v1/targets/localhost/recordings
CRYOSTAT_DISABLE_BUILTIN_DISCOVERY=true