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.

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
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

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.
At least one of attributes and multiValueAttributes must name an
expression; a request with neither 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.

string

Comma-separated list of CEL expressions that each yield a list of
strings per monitor. The elements are counted across every matching
monitor, one count per element, so a monitor with two values adds
one to each. Maximum 10 entries. CSV-escaped like attributes.

The expressions with a SQL form are a monitor's tag keys,
objectTags.map(k, k), and one tag's values,
objectTags["team"] or ("team" in objectTags ? objectTags["team"] : []).
A monitor without the tag adds nothing to either form of the
values. Any other list, such as a tag's values filtered or mapped,
returns 400.

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