Get Resource Usage
resource_usage_getCurrent resource usage for an app's environment(s): CPU and memory
usage against configured limits, network bytes, and (for each
environment's database add-on) connection count, storage, average
query time, and backup size. Also returns meters: the app's
hosting/infrastructure metered usage for the CURRENT BILLING PERIOD
(bandwidth GB, autoscaling uptime hours, database storage MB) against
its plan limit.
UNITS: read these before interpreting a number: cpu.utilization
is a FRACTION 0 to 1 of cpu.configured (the configured vCPU count,
a free-form string like "1" or "2"), NOT a percentage and NOT an
absolute vCPU figure; multiply by 100 yourself for a percent, or
combine with cpu.configured if you need "42% of 2 vCPU" phrasing.
memory is the opposite: used_mb/configured_mb are both already
ABSOLUTE megabytes. network.egress_bytes/ingress_bytes are
bytes, but NOT a cumulative total and NOT necessarily fresh: the
collector sums these counters over a trailing ~30-minute WINDOW and
rewrites the row every ~2 minutes, so consecutive reads overlap
heavily (do not sum them to get a total), and when a window's true
sum is zero, the row keeps its PREVIOUS byte count while still
stamping a current sampled_at, so a quiet environment can look
like a fresh nonzero reading.
These are PERIODIC SAMPLES, not live reads. Meridian's collector
samples every ~2 minutes over a rolling ~30-minute window, so a
number can be up to a few minutes stale. meters, in contrast,
refresh on their OWN, SLOWER cadence: HOURLY, via the
usage:sync-meters schedule, so a meter value can lag the
environment snapshot by up to an hour; check each meter's own
as_of rather than assuming it is as fresh as the rest of the
payload. For trends over time (a chart, an alert on a rate of
change), use resource_usage_history instead.
Each meters entry: limit: null means UNLIMITED, limit: 0 means
NO ALLOWANCE was granted at all (both distinct from a positive cap).
unlimited makes the null case explicit. used: null means the
meter has never been measured for this app (distinct from 0,
measured-and-idle); as_of is the measurement timestamp, null
exactly when used is null. remaining is null when unlimited or
when used is null; otherwise max(0, limit - used). over_limit
is always false when unlimited or unmeasured.
Takes the app_id returned by apps_list. Optionally scope to one
environment_id (from environments_list); omitted returns every
environment. An environment that has never deployed, or that the
collector has not sampled yet, is still returned, with
sampled_at: null and every usage field null, never dropped or
errored. disk usage is deliberately absent: Cloud Run has no
persistent disk, so the platform never has a number to report there.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"app_id": "<app_id>"
},
"name": "resource_usage_get"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | The app uuid returned by `apps_list`. | |
| environment_id | No | Scope to a single environment uuid returned by `environments_list`. Omitted: every environment of the app. | |
| organization_id | No | An organisation uuid or slug. When supplied, `app_id` is resolved within that organisation and may be a slug instead of a uuid, mirroring the Meridian web app. |