metrics
Show what applications are using right now.
read onlyrepeatable
What applications are using right now: processor, memory, and how many instances are reporting.
Every figure is per instance, because the limit is per instance too. An application running five copies at half its memory is using five halves of one limit, not two and a half limits.
Usage
outplane metrics [APP]Arguments
| Argument | Type | Description |
|---|---|---|
APP | string | Application name or id. Omit for the whole team. |
Output
| Field | Type | Description |
|---|---|---|
app | string | |
cpuMillicores | int | 1000 millicores is one core. |
cpuPercent | int | null | Against the per-instance limit. null when no limit is on record, and above 100 when the app is over it. |
memoryBytes | int | Working set, per instance. |
memoryPercent | int | null | Against the per-instance limit. |
networkInBps | float | Bytes per second received. |
networkOutBps | float | Bytes per second sent. |
diskReadBps | float | |
diskWriteBps | float | |
instances | int | How many instances are reporting, which is what is running. It differs from the configured count while an app is starting, stopping or partly crashed. |
cpuLimitMillicores | int | What one instance may use. |
memoryLimitMb | int | What one instance may use. |
Examples
What everything is using
outplane metricsOne application
outplane metrics checkoutFind what is near its limit
outplane metrics --json --fields app,cpuPercent,memoryPercent{
"items": [
{
"app": "checkout",
"cpuPercent": 12,
"memoryPercent": 83
},
{
"app": "worker",
"cpuPercent": 0,
"memoryPercent": 4
}
],
"total": 2,
"truncated": false
}What to Know
- Every figure is per instance, not per application: usage is averaged across the instances, because the limit is per instance too. An app running five replicas at 50% is using five halves of a limit, not 250% of one.
- instances is what is reporting, which is not the configured replica count.
app listhas the configured one, and a difference between them means the app is starting, stopping or partly crashed. - cpuPercent and memoryPercent are null when no limit is on record, and never capped: over 100 is a real state and the most useful thing this reports.
- An application with no running instances reports zeroes rather than being omitted, so a paused app is visible as a paused app.
- Naming one application filters the rows, not the queries. Cost is the same whether you ask about one or all of them, so ask once rather than in a loop.
- Rates are two-minute averages. Two calls a second apart return nearly the same numbers, and neither shows a spike that lasted seconds.
- The text table writes bytes and rates in units a person reads. The machine formats carry the raw numbers, so nothing has to be parsed back.
Errors
Beyond 0 for success, this command exits with:
| Exit | Kind | Meaning |
|---|---|---|
2 | usage | Invalid arguments, unknown flag, or client-side validation failure. |
3 | auth | Not authenticated, token revoked or expired, or forbidden for this team. |
5 | not_found | The named resource does not exist, or is not visible to this credential. |
8 | upstream | The Out Plane API returned a server error. |
The code on the error object is one of logs.no_team_slug, app.not_found, usage.empty_argument, metrics.bad_response, metrics.query_refused, context.no_team. Branch on that, or on the exit status. The message is prose and changes.