Get monitor attribute statistics

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.

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
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string

CEL expression restricting which monitors contribute to the
statistics. Must evaluate to bool. Must be URL-encoded. If omitted,
statistics cover every monitor the caller may read. See
GET /v1/monitors for the field list and examples.

string
required

Comma-separated list of the fields to group by — a field name from
the GET /v1/monitors filter table, or a CEL expression over those
fields. One statistic is computed per entry. Maximum 20 entries; an
empty list returns 400.

Because an expression may itself contain a comma or a quote, the list
is CSV: wrap an entry in " if it holds either, and double any
literal " inside a wrapped entry. CSV-escape first, URL-encode
second. A bare field name needs neither, so the common case is just
attributes=health,ruleKind.

int64
required
1 to 100

Number of top values to return per attribute, sorted by count
descending. Range 1–100. Each attribute's total distinct count is
reported in distinctCount regardless, so a caller can tell when
values were left out.

Responses

Language
Credentials
Bearer
Authorization: Bearer <customerid> <apitoken>
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json