App metrics
Aggregates over a range: request counts by status class, outcomes, latency histograms, wakes, CPU and memory.
One-minute points are kept 7 days, hourly points longer (retention in the answer says how long).
totals.request_cpu and each point’s request_cpu ({hist, p50_ms, p95_ms, p99_ms, sum_ms}) are the CPU time of each request the runtime stamped one on, in the
buckets of duration_bounds_ms; they are absent where no request reported a CPU time (a host from before logs step 2, a quiet minute).
The per-bucket arrays have a fixed order (listed on each field); a new entry is only ever added at the end, so read them by position and ignore a longer array.
/v1/apps/{project}/metricsAuthorizationBearer token · headerrequiredA team API key, sbk_..., from Settings, API keys.
x-api-keyAPI key · headerrequiredThe same key, in a header of its own.
projectstringrequiredThe app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.
rangestring1h24h7d30d90dThe metrics.
rangestringrequiredThe range asked for.
1h24h7d30d90dstep_secondsintegerrequiredThe width of one point: 60 for 1h, 600 for 24h, 3600 for 7d and 30d, 86400 for 90d.
fromstring<date-time>requiredtostring<date-time>requiredretentionobjectrequiredShow propertiesHide properties
minute_daysintegerrequiredHow long one-minute points are kept (7).
hourly_daysintegerrequiredHow long hourly points are kept (90).
notestringrequiredduration_bounds_msnumber[]requiredUpper bounds, in milliseconds, of the buckets of every histogram here (dur, wake_dur, request_cpu.hist): 0.5, 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000. Each histogram has one more entry than this list, for everything above the last bound.
outcome_namesstring[]requiredThe names, in order, of the entries of outcomes: ok, exception, exceededCpu, exceededWallTime, canceled, rateLimited, suspended, unavailable, queueFull.
memory_limit_bytesinteger | nullrequiredThe app's memory limit, or null while neither a host reading nor a limit in the spec is known.
pointsMetricsPoint[]requiredOldest first; a step with no data has no point.
Show propertiesHide properties
MetricsPointrequestsintegerrequiredRequests answered.
statusinteger[]requiredSix counts in this order: no status, 1xx, 2xx, 3xx, 4xx, 5xx.
outcomesinteger[]requiredNine counts in the order of outcome_names.
durMetricsHistogramrequiredCounts per bucket of duration_bounds_ms, with a last entry for everything above the last bound (15 entries).
p50_msnumber | nullResponse time quantiles from dur, linear inside the bucket; null with no requests. The overflow bucket answers its lower bound (10000).
p95_msnumber | nullp99_msnumber | nulltriginteger[]requiredFour counts in this order: scheduled ok, scheduled failed, other ok, other failed.
wakesintegerrequiredTimes the app was started for a request or trigger.
sleepsintegerrequiredTimes it was put to sleep.
cpu_usintegerrequiredCPU time of the worker process, microseconds.
oom_killsintegerrequiredcrashesintegerrequiredrequest_cpuRequestCpuThe CPU time of each request the runtime stamped one on, in the buckets of duration_bounds_ms. Absent (the key is not there, not zero or null) where no request
reported a CPU time: a host from before logs step 2, or a quiet minute. Read it as optional; an app on an old host has none.
Show propertiesHide properties
histMetricsHistogramrequiredCounts per bucket of duration_bounds_ms, with a last entry for everything above the last bound (15 entries).
p50_msnumber | nullrequiredCPU time per request at the median, milliseconds, from hist.
p95_msnumber | nullrequiredp99_msnumber | nullrequiredsum_msnumberrequiredTotal CPU time of those requests, milliseconds; a mean is sum_ms over the sum of hist.
tstring<date-time>requiredThe start of the step.
dur_usintegerrequiredThe summed response time, microseconds; with requests it gives the mean.
wake_durMetricsHistogramrequiredCounts per bucket of duration_bounds_ms, with a last entry for everything above the last bound (15 entries).
wake_usintegerrequiredThe summed wake time, microseconds.
mem_peakinteger | nullrequiredThe largest memory peak seen in the step, bytes.
mem_curinteger | nullrequiredThe last memory reading in the step, bytes.
totalsMetricsTotalsrequiredThe sum over the range.
Show propertiesHide properties
requestsintegerrequiredRequests answered.
statusinteger[]requiredSix counts in this order: no status, 1xx, 2xx, 3xx, 4xx, 5xx.
outcomesinteger[]requiredNine counts in the order of outcome_names.
durMetricsHistogramrequiredCounts per bucket of duration_bounds_ms, with a last entry for everything above the last bound (15 entries).
p50_msnumber | nullResponse time quantiles from dur, linear inside the bucket; null with no requests. The overflow bucket answers its lower bound (10000).
p95_msnumber | nullp99_msnumber | nulltriginteger[]requiredFour counts in this order: scheduled ok, scheduled failed, other ok, other failed.
wakesintegerrequiredTimes the app was started for a request or trigger.
sleepsintegerrequiredTimes it was put to sleep.
cpu_usintegerrequiredCPU time of the worker process, microseconds.
oom_killsintegerrequiredcrashesintegerrequiredrequest_cpuRequestCpuThe CPU time of each request the runtime stamped one on, in the buckets of duration_bounds_ms. Absent (the key is not there, not zero or null) where no request
reported a CPU time: a host from before logs step 2, or a quiet minute. Read it as optional; an app on an old host has none.
Show propertiesHide properties
histMetricsHistogramrequiredCounts per bucket of duration_bounds_ms, with a last entry for everything above the last bound (15 entries).
p50_msnumber | nullrequiredCPU time per request at the median, milliseconds, from hist.
p95_msnumber | nullrequiredp99_msnumber | nullrequiredsum_msnumberrequiredTotal CPU time of those requests, milliseconds; a mean is sum_ms over the sum of hist.
errors_5xxintegerrequiredstatus[5].
mem_peakinteger | nullrequiredThe largest memory peak in the range, bytes.
The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredinvaliderrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerNo key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key lacks a grant (reason: forbidden, need: "<resource>:<action>").
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredforbiddenneedstringrequiredThe grant, as <resource>:<action>, for example app:write.
No such app, build, secret, manifest or claim in this team (another team's resource looks the same).
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key is over its requests a minute (600, or 2,000 with app:write; reason: key-rate-limited, retry_after_s, Retry-After). Wait that long and retry.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredkey-rate-limitedretry_after_sintegerrequiredSeconds to wait; also the Retry-After header.