Docs menu

get_stats

This page answers what get_stats returns, what it takes, and what an unknown health means.

Purpose

get_stats reports how each held thing is doing now: its health by default, plus timestamped metrics with metrics: true. It never returns secrets and changes nothing.

Inputs

InputTypeMeaning
kindslist of textKeep only these record kinds. Omit it for every active kind.
lookupslist of textKeep only these record lookups. Omit it for every record.
metricstrue or falseAlso return timestamped metrics beside health. Default false.

Example

{ "kinds": ["DataConnections"], "metrics": true }

The answer is { Kinds: { <Kind>: { <Lookup>: ... } } }.

The Licenses line

Beside Kinds, the answer carries Licenses: for each licence the workspace sells, its Stripe health Status (Healthy, Degraded, Unhealthy or Unknown) and the codes of its problems, never a value. It needs the Licenses.Read right. When it cannot be read, it is Known: false with a Reason and a Remedy, such as LICENSES_HEALTH_UNREACHABLE; the other lines are unaffected. Asking only for other kinds leaves it out. For the checks behind a status, and for stats, events and subscribers, see the Licenses reads of call_api.

Errors

  • A Health.Status of "unknown" carries a Detail that says why.
  • A kind that reports nothing answers Known: false with the reason NO_STATS_SOURCE.
  • An unknown name in kinds is refused with the list of active kinds.
On this page