metrics.v1.MetricsService to answer questions such as “how many
invocations failed in the last hour?” and “how long do cold boots take by
day?” The web UI’s dashboards use the same three read-only RPCs. Their
messages are defined in protos/metrics/v1/metrics.proto.
QueryTimeseries and QueryAggregate read the invocations table in
PostgreSQL, so an invocation counts once its record is written. GetQueue
reads the queue on NATS instead. Every query is scoped to the caller’s tenant.
RPCs
Metrics
Duration means skip invocations that never reached the phase. An errored call
with no acquire does not pull the acquire mean toward zero.
Dimensions
Since every query is scoped to the caller’s tenant, grouping by tenant returns
one group.
QueryTimeseries
Every series has the same ascending buckets over the window, zero-filled, so
points at the same index refer to the same bucket. Each point’s
values
follow the order of metrics. When a filter covers the group_by dimension,
the response has one series per requested value, in request order, even when
a value has no invocations.
QueryAggregate
Takes the same fields exceptgranularity and tz_offset_minutes. The
response has one AggregateRow per group for the whole window, with key and
values in the order of metrics.
GetQueue
Takesfunction_ids, or every function of the tenant when empty. Returns
queued, invocations waiting to start (in the queue, or taken by a host that
is building the function or waiting on its max_concurrency), and running,
from what live hosts last reported. If the queue cannot be read, the call is
unavailable.
Errors
A missingsince_ms, an until_ms not after it, a window over 90 days, no
metrics, an unsupported metric or a missing granularity are each
invalid_argument. A failed query against PostgreSQL is also reported as
invalid_argument.