Counts monitors by one or more fields. No monitors are returned. Each
entry in attributes is a field to group by, and the response carries one
block per entry: that field's distinct-value count, and its most frequent
values with a count each. Grouping by health answers "how many monitors
are in each health state".
Fields are the ones GET /v1/monitors lists under filter, written the
same way. An entry may also be a CEL expression over them, for buckets no
single field provides: aiTriagingMode == "Triage" gives "true" and
"false" rather than one bucket per stored mode. The expression must yield
one scalar per monitor — that value becomes the bucket key — so a list or
object is rejected with 400.
To count the elements of a list instead, such as a monitor's object tag
keys or one tag's values, name the expression in multiValueAttributes.
Each element is a bucket, and a monitor adds one to every element of its
list, so the counts there may exceed meta.filteredMonitors. A monitor
whose expression reads a tag it does not have adds nothing.
Keys come back as JSON strings whatever the field's type: numbers as
decimal digits, bools as "true" or "false", timestamps as RFC 3339.
meta reports totalMonitors (before the filter) and filteredMonitors
(after).
For example, facet counts for the list's Health and Type columns:
GET /v1/monitors/stats?attributes=health,ruleKind&topK=10
The AI column's two buckets, over enabled monitors only. Both values hold
quotes, so both are CSV-escaped — inner " doubled, the item wrapped —
then URL-encoded:
GET /v1/monitors/stats
?attributes="aiTriagingMode == ""Triage"""
&filter=disabled == false
The object tag keys, and the values of the team tag, for a search
bar's suggestions. Both hold a comma or a quote, so both are
CSV-escaped:
GET /v1/monitors/stats
?multiValueAttributes="objectTags.map(k, k)","(""team"" in objectTags ? objectTags[""team""] : [])"
&topK=100| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||