Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Eat up fewer resources in Cryostat 2.1 with sidecar reports

May 25, 2022
Hareet Dhillon
Related topics:
ContainersJavaKubernetes
Related products:
Red Hat OpenShift LocalRed Hat OpenShift Container Platform

Share:

    Cryostat is a tool for managing JDK Flight Recorder data on Kubernetes. Version 2.1 of Cryostat introduces the option of using a sidecar reports container to generate automated analysis reports for JDK flight recordings. Previously, the main Cryostat container handled the report generation. Report generation is a resource-intensive operation, and as a result, users may find themselves overprovisioning the Cryostat container to meet peak resource demands. Those resources may in turn end up unused if you're not generating reports.

    With this new option to delegate report generation to a sidecar container, users will find it easier to provision resources more efficiently. When report generation is not a concern, the main Cryostat container, including its web server and various lightweight operations over HTTP and JMX, has only a small resource footprint. Based on their report generation workflow, users can provision resources to the sidecar reports container accordingly and spin up any number of replicas of that container.

    This article explores the process of setting up sidecar report container replicas for automated analysis report generation using Cryostat on Red Hat OpenShift.

    Prerequisites for using a sidecar container

    To get started, use a running OpenShift or Kubernetes cluster with the Cryostat Operator installed. If you don’t already have access to an OpenShift or Kubernetes cluster, try Red Hat OpenShift Local. This article utilizes the OpenShift UI to interact with the Cryostat Operator.

    Then, deploy a containerized Java application with Java Management Extensions (JMX) enabled and exposed running in the same namespace as the Cryostat Operator. To learn more about how to fulfill this requirement by creating a sample Quarkus application, refer to the Red Hat Developer article Configuring Java applications to use Cryostat.

    Create the Cryostat resource with the sidecar reports container enabled

    Once the Cryostat Operator is installed, setting up the sidecar reports container is a straightforward process. Navigate to the Cryostat Operator under the Installed Operators tab on the OpenShift web console, then create an instance of the Cryostat resource (see Figure 1).

    The Cryostat Operator page under Installed Operators on the Openshift web console, with Create instance highlighted.
    Figure 1: Select Create instance to create the Cryostat resource.

    This will direct you to the Create Cryostat page, which provides various configuration options as shown in Figure 2.

    The Cryostat resource creation page titled Create Cryostat with various configuration options.
    Figure 2: The configuration options for the Cryostat resource.

    Scroll down to select Report Options followed by Resources (see Figure 3).

    The report generation configuration options for the Cryostat resource. Users can configure any number of replicas of the sidecar container, with resource limits and requests options for CPU cores, memory and storage. There's also an option to set the sub process maximum heap size for reports generated using the Cryostat instance itself instead of the sidecar container.
    Figure 3: Select your report generation configuration options.

    Next, select the number of replicas of the reports sidecar container to deploy and configure the Limits and Requests resources for each replica. The default number of replicas is 0, meaning the main Cryostat container handles the report generation through a sub-process. The default maximum heap size of this sub-process is 200MiB, but the user can adjust the maximum limit as needed. The Sub Process Max Heap Size field will be ignored if you request at least one reports sidecar container replica.

    For this example, you should create the Cryostat instance using the report options configuration shown in Figure 4.

    A reports configuration with the number of Replicas set to 1, Limits set to 500m CPU cores, 5G of memory and 20G of storage, and Requests set to 250m CPU cores, 2G of memory and 10G of storage.
    Figure 4: Configure the Replicas, Limits, and Requests fields as shown here, then scroll down and select Create.

    To generate the automated analysis report, navigate to the Cryostat web client. From the Cryostat Operator page under Installed Operators, select the Cryostat tab and then select the cryostat-sample resource. On the resulting page, you can find the URL for the web client (Figure 5).

    Installed Operators -> Cryostat Operator -> Cryostat -> cryostat-sample -> Application URL highlighted.
    Figure 5: Follow the Application URL to access the Cryostat web client.

    A prompt will request your cluster credentials to authenticate with the web client. After logging in, select a target application (whether it’s of your own making or the sample Quarkus application we linked to above) and navigate to the Recordings tab (Figure 6). Create a fixed duration custom flight recording. Once it is finished, request an automated analysis report of the recording. For a more detailed walk-through of these steps, refer to the Guides on using Cryostat.

    The Recordings view for the sample Quarkus application in the Cryostat web client, after a recording has been stopped and its automated analysis report generated.
    Figure 6: Requesting the automated analysis report will trigger the report generation in the sidecar container.

    To double-check that the sidecar report container handled the report generation, go back to the OpenShift console and navigate to Pods under the Workloads tab. This is where you can find the pod containing the sidecar report container (see Figure 7).

    OpenShift console -> Workloads -> Pods -> cryostat-sample-reports-{RANDOM_STRING} highlighted, where RANDOM_STRING is a randomly generated alphanumeric string that is appended to the cryostat-sample-reports Pod name.
    Figure 7: Select the cryostat-sample-reports pod. Your pod name will also be appended with a randomly generated alphanumeric string.

    Next, go to the Logs tab, shown in Figure 8, and pause the log stream. Then scroll through the repeated HTTP GET /health requests to locate the log messages confirming that the sidecar reports container received and fulfilled an HTTP request from the main Cryostat container.

    The sidecar report container logs showing the report generation HTTP request from the main Cryostat container.
    Figure 8: The sidecar report container receives and responds to a request from the main Cryostat container for the generated report.

    Conclusion

    Using a sidecar report container for automated analysis report generation allows users to efficiently provision resources for Cryostat. For more information about Cryostat, visit cryostat.io. For questions, comments, and feedback, feel free to connect with us on GitHub or join our mailing list.

    Find more Cryostat tutorials on Red Hat Developer:

    • Introduction to Cryostat: JDK Flight Recorder for containers
    • How to build automated JFR rules with Cryostat 2.1's new UI

    • Tutorial: Configuring Java applications to use Cryostat

    Last updated: November 6, 2023

    Recent Posts

    • Profiling vLLM Inference Server with GPU acceleration on RHEL

    • Network performance in distributed training: Maximizing GPU utilization on OpenShift

    • Clang bytecode interpreter update

    • How Red Hat has redefined continuous performance testing

    • Simplify OpenShift installation in air-gapped environments

    What’s up next?

    The microservice architectural approach is more than just about technology: It reaches into the foundation of your organization to allow you to build truly scalable, adaptive, complex systems that help a business adapt to rapidly changing competitive markets. In Microservices for Java Developers, you'll get a hands-on introduction to frameworks and containers through a handful of familiar patterns.

    Get the free e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue