This topic tells you about the metrics that are emitted by all containers managed by VMware Tanzu Application Service for VMs (TAS for VMs) and its scheduling system, Diego.

Application metrics include the container metrics, and any custom application metrics that developers create.

Diego Container metrics

Diego containers emit resource usage metrics for the application instance. Diego averages and emits each metric every 15 seconds.

The following table describes all Diego container metrics:

Metric Description Unit
CpuPercentage CPU time used by AI as a percentage of a single CPU core.

This is usually no greater than 100% * the number of vCPUs on the host Diego cell, but it might be more due to discrepancies in measurement timing.
float64
AbsoluteCPUEntitlement CPU time that the AI was entitled to use.

At minimum, the CPU time that a Diego cell provides an AI is min(app memory, 8 GB) * (Diego cell vCPUs/Diego cell memory) * 100%.

The platform operator can provide the Diego cell vCPUs/memory ratio to developers.
If a Diego cell is not at capacity or if other workloads on it are idle, the cell can provide more than the minimum CPU.
uint64
AbsoluteCPUUsage CPU time used by AI.

AbsoluteCPUUsage / AbsoluteCPUEntitlement calculates a 0-100% range of AI usage per entitlement.
uint64
MemoryBytes RAM memory used by AI, in MB. uint64
MemoryBytesQuota RAM memory available, in GB. uint64
DiskBytes Disk space used by AI, in MB. uint64
DiskBytesQuota Disk space available, in GB. uint64
ContainerAge Age of container, in nanoseconds. uint64

Loggregator v1: Most of the container metrics are emitted in a ContainerMetric envelope. The AbsoluteCPUEntitlement, AbsoluteCPUUsage, and ContainerAge container metrics are emitted as separate ValueMetric envelopes.

Loggregator v2: All container metrics are emitted in gauge envelopes. The AbsoluteCPUEntitlement, AbsoluteCPUUsage, and ContainerAge container metrics are emitted in a separate envelope to the other container metrics.

Retrieve Container Metrics from the cf CLI

You can use Cloud Foundry command-line interface (cf CLI) commands to return container metrics.

Retrieving Container metrics from the cf CLI

You can retrieve container metrics using the Cloud Foundry Command Line Interface (cf CLI).

To retrieve CPU, memory, and disk metrics for all instances of an application, see Retrieve CPU, Memory, and Disk Metrics.

To retrieve CPU entitlement metrics for all instances of an application, see Retrieve CPU Entitlement Metrics.

To determine when an application has exceeded its CPU entitlement, see Monitor Apps That Exceed Their CPU Entitlement.

Retrieving CPU, Memory, and Disk metrics

To retrieve CPU, memory, and disk metrics for all instances of an application:

  1. Run the command cf app APP-NAME.

The command output lists Diego container metric values as follows:

Label in Output Metrics listed, as described in Diego Container Metrics
cpu CpuPercentage
memory MemoryBytes of MemoryBytesQuota
disk DiskBytes of DiskBytesQuota
type:           web
sidecars:
instances:      1/1
memory usage:   1024M
     state     since                  cpu    memory        disk          logging            details
#0   running   2022-09-16T01:38:46Z   0.2%   36.3M of 1G   90.3M of 1G   0/s of unlimited
</pre>

The command shows the percentage of CPU the app is currently using relative to the total CPU on the host machine.

Retrieving CPU Entitlement metrics

name: dora-example requested state: started routes: dora-example.bosh-lite.com last uploaded: Fri 05 Apr 10:41:21 PDT 2019 stack: cflinuxfs3 buildpacks: ruby

type: web instances: 1/1 memory usage: 256M state since cpu memory disk details

0 running 2019-04-05T17:41:31Z 0.4% 39.5M of 256M 89.9M of 1G

Retrieve CPU Entitlement Metrics (Experimental)

To see application instance AbsoluteCPUEntitlement metrics from the command line:

  1. Install the CPU Entitlement Plugin from cpu-entitlement-plugin in GitHub.

Determining when Applications exceed their CPU Entitlement

You can use the Cloud Foundry CPU Overentitlement Plug-in to determine when an application has exceeded its CPU entitlement and might need to be scaled up.

$ cf cpu-entitlement dora-example
Note: This feature is experimental.
Showing CPU usage against entitlement for app dora-example in org example-org / space example-org-staging as [email protected] ...
​
     avg usage   curr usage
#0   1.62%       1.66%
#1   2.93%       3.09%
#2   2.51%       2.62%
​
check-circle-line exclamation-circle-line close-line
Scroll to top icon