List metrics

List metrics defined by, or auto-discovered in, the customer's metric
datasets that the user has read access to. Default page size is 100; maximum is 1000.
Default ordering is by name ascending, then dataset.id ascending.
Set expand=true to inline reference fields (dataset.record, …). Without expand,
references contain only id.

Filtering and ordering with CEL

The filter and orderBy query parameters are evaluated as
Common Expression Language (CEL) expressions
against a stable schema that mirrors the metric response body.
filter must evaluate to bool; orderBy is a CSV list of
CEL expressions whose values must be comparable. URL-encode
both; CSV-escape orderBy items first (see the orderBy
parameter for syntax).

Available CEL functions

The metric CEL environment registers the CEL standard
definitions

(operators, in, ?:, size(), string.contains, string.startsWith,
string.endsWith, matches, etc.) plus the following extension
libraries from
cel-go v0.28.0:

  • ext.StringscharAt, indexOf, join, lowerAscii, replace, split, substring, trim, upperAscii, format
  • ext.Listslists.flatten, lists.range, lists.slice
  • ext.Mathmath.greatest, math.least
  • ext.Setssets.contains, sets.equivalent, sets.intersects
  • ext.Regexre.capture, re.extract
  • ext.Encodersbase64.encode, base64.decode
  • ext.Bindingscel.bind for let-binding sub-expressions
  • ext.Protos — protobuf helpers
  • cel.OptionalTypesoptional.of, optional.ofNonZero, optional.none
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
int64

Maximum number of items to return in the response

int64

Number of items to skip before starting to collect the result set

boolean

Whether to expand resources referenced in the response to include additional fields

string

CSV list of CEL expressions, each producing a comparable
value. Prefix an item with - for descending order.

CSV-escape first, then URL-encode. Wrap an item in " if it
contains a comma or "; double a literal " to "" inside
a quoted item.

Supported fields: See the description of the filter parameter for the
list of supported fields.

string

Filter that response metrics must match. Specified in CEL format.
Note that filter expressions must be URL encoded.

Supported filter fields:

  • name (string): metric name
  • type (string): metric type
  • unit (string): metric unit
  • description (string): metric description
  • rollup (string): metric rollup
  • aggregate (string): metric aggregate
  • userDefined (bool): whether the metric is user-defined
  • status (string): metric status
  • dataset.id (int): ID of the metric dataset
  • dataset.label (string): label of the metric dataset
  • lastReported (timestamp): last reported time
  • metricTags (list): tag paths observed for this metric. Each
    element is an object with field (string) and path (string).
    Use CEL macros to test membership, e.g.
    metricTags.exists(t, t.field == "container").
  • correlationTags (list): correlation tags relevant to this
    metric. Each element is an object with tag (string) and path
    (an object with field and path). e.g.
    correlationTags.exists(c, c.tag == "service.name").

See the Metric-Resource schema for the detailed descriptions of the supported fields.

CEL functions

hasCorrelationTag(tag string, value string) bool

Returns true if this metric has data points whose correlation tag
tag takes on value within a recent observation window.

Both arguments must be constant string literals.

Limits and error conditions:

  • HTTP 400 if a single filter references more than 8 unique
    hasCorrelationTag(T, V) callsites.
  • For each (tag, value) pair, fan-out is capped at 10 candidate
    datasets, selected deterministically in ascending dataset id.
    Datasets beyond the cap are not consulted for that pair.
  • HTTP 500 if the OPAL query fails (e.g. Snowflake unavailable).
  • HTTP 503 if no query backend is wired (test / degraded apiserver).
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