BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Announcing Cryostat 2.0: JDK Flight Recorder for Containers

Announcing Cryostat 2.0: JDK Flight Recorder for Containers

This item in japanese

Lire ce contenu en français

Cryostat, a container-native JVM application developed by Red Hat, provides an API for monitoring and profiling Java containers using Java Flight Recorder (JFR).

The main features this new release brings are: Cryostat Operator that simplifies the deployment of Cryostat in OpenShift; automated rules definitions that allow users to specify which JVMs should be activated on and what JDK Flight Recorder events should be recorded; and batch operations that allow clients to execute one request and Cryostat will retrieve data from a set of targets and Custom targets that allow users to manually define targets.

Java Mission Control (JMC) and Java Flight Recorder (JFR), once commercial features and only included in Oracle Java builds, were both released as open source in 2018. This allowed the powerful profiling and diagnostic features to be made available and included in all versions from OpenJDK 11 onward.

But JMC is a desktop application, therefore is not well suited for containerization. It requires users to retrieve flight recordings on a local disk or use potentially insecure JMX connections to remote JVMs.

In the same way, JFR allows the storage of the recordings on a local disk, but when the application runs inside a container the local storage could not be easily accessible.

Cryostat connects JFR data in the cloud with end-users at their workstations. In fact, it acts as a hub for retrieving and storing flight recordings from containerized JVMs, so users can access these recordings over HTTP/HTTPS.

Cryostat is a containerized JVM that acts as a "sidecar" alongside other OpenJDK applications to monitor. The discovery of these other runtimes could happen in different ways, automatically selected by Cryostat. It can use Java Discovery Protocol for applications running with docker-compose while endpoints may be used for applications running inside Kubernetes or Openshift. Other discovery methods are available.

Cyostat also supports JFR event templates to control which events will be enabled during the recording. Templates could also be edited and customized. In the image below is an example of event types in Cryostat.

Furthermore, Cryostat offers different ways to manage recordings, including custom recordings, snapshots, and archives. The first option allows the user to configure parameters of the recording such as name, duration, size, etc. The second option is an overview of all of the information captured by other recordings while the third option immediately sends the data of a snapshot to Cryostat in order to save it on local disk or a persistent volume.

Cryostat also enables automated analysis using JMC in the back-end or, for more advanced reporting, it is possible to export data to Grafana with a provided pre-configured dashboard.

In conclusion, Cryostat brings JFR into the container age, allowing analysis and profiling of multiple JVMs directly from a central hub.

Rate this Article

Adoption
Style

BT