Skip to main content
U.S. flag

An official website of the United States government

Monitoring your application's health using OpenSearch

March 27, 2025

One of the benefits of hosting your applications on Cloud.gov is that it offers performance metrics for monitoring the health of your application.

The most important metrics for monitoring your application’s health are the memory and CPU metrics, which can help you identify:

A note about CPU metrics

Your application runs in one or more application containers distributed across Diego cell virtual machines (VMs). CPUs are virtualized and shared with other application containers on the VM.

The CPU usage figure reported as part of the application metrics represents the CPU usage of an application instance as a percentage of a single CPU core. Since there are usually multiple CPU cores per VM, it is possible for the CPU usage to exceed 100%, which means your application is using the equivalent compute power of more than a single CPU core.

A CPU usage figure above 100% is not necessarily problematic. The more important metric for identifying issues is CPU entitlement, which is a formula Cloud Foundry uses to determine how much CPU your application is allowed to use from the host VM based on its memory capacity.

If the CPU entitlement figure exceeds 100% for any application instance, then the instance is effectively borrowing spare CPU resources from the host VM. Since applications are regularly redistributed across the available host VMs, the amount of spare CPU capacity available on the VM can change, so any instances of CPU entitlement above 100% should be treated as an indication of insufficient application resources and addressed appropriately by adding more instances or allocating more memory.

While the CPU usage figure itself does not independently reveal application issues, it is still worth monitoring as a relative value, since sudden spikes in the value can still indicate abnormal performance of your application.

Retrieving current memory and CPU metrics

To retrieve the current memory, CPU usage and CPU entitlement for your app, you can use the cf app command:

cf app APP-NAME

The output from running that command will look something like:

"Screenshot of application summary printed in a terminal session by the cf app command"

The cpu and memory metrics in the output can be interpreted as follows:

  • cpu: percentage of CPU used by the application, as explained above.
  • memory: memory used out of the amount of memory allowed for each application instance.
  • cpu entitlement: CPU time used by an app instance as a percentage of its CPU entitlement.

How to view historical memory and CPU metrics in OpenSearch

While it is useful to view your application’s CPU and memory usage at a given point in time, what is usually more helpful is to see the trends in your application’s health metrics over time and in particular whether they correlate to observed performance issues for your application.

Logs containing these application metrics are already ingested into the OpenSearch instance for customer logs. Furthermore, there are already built-in visualizations and dashboards for viewing these metrics for your applications.

To view the dashboards for application metrics, follow these steps:

  1. Log in to OpenSearch.
  2. Click Dashboard in the bookmark links at the top of the page.

    "Screenshot of OpenSearch interface with an arrow pointing towards the Dashboard bookmark at the top of the page"

  3. Enter App - Metrics in the search bar on the Dashboards page and click the link to the App - Metrics dashboard in the results.

    "Screenshot of OpenSearch dashboards search page with App - Metrics as the search query"

  4. The App - Metrics dashboard should automatically populate with metrics for a graph of CPU usage, memory usage (in bytes), and disk usage for all of your applications. Add filters (e.g. @cf.space) to limit the results to the desired applications and adjust the time filter to see metrics for the desired time period.

    "Full-page screenshot of the App - Metrics dashboard in OpenSearch displaying visualizations of CPU usage, memory usage, and disk usage based on application metrics"

If you encounter any difficulties using these dashboards or have any questions about them, please contact support@cloud.gov and we would be happy to assist you.

cloud.gov

An official website of the U.S. General Services Administration

Looking for U.S. government information and services?
Visit USA.gov