Metric Groups & Aliases
Wildcard Grouping
Wildcard grouping is useful for selecting many related metrics. The Instrumental Query Language uses dots (.
) as part delimiters, and supports ?
for single-part matching and *
for multi-part matching.
Single-Part Wildcard Group
The single-part wildcard (?
) pattern will match one part of the name:
?.cpu
would return the metrics a.cpu
and b.cpu
but not staging.a.cpu
.
Multi-Part Wildcard Group
Unlike the single-part (?
) pattern, the wildcard (*
) will match many parts of a metric. It uses the pattern:
test.* test.db-* test.db-*.cpu
List Group
When submitting expressions via the metrics API, you can use the semi-colon as a delimiter between multiple expressions. Note: this is equivalent to viewing multiple expressions on a graph in the Instrumental UI.
test.metric_a;test.metric_b
Aliases
Complex expressions can be hard to follow, so aliases let you assign any name to an expression so it can be understood at a glance. Aliases are created with the as
keyword:
test.metric_a as metric_a
which will return the values of test.metric_a under the name metric_a. If you use the as
keyword with a group of metrics, each of the metrics returned will have their name prefixed with the alias provided. For example, if your account had the metrics test.a
, test.b
, and test.c
, the following request:
test.* as mytest
would return the metrics mytest.test.a
, mytest.test.c.other