series(metric, tag, options={})

At the lowest level of a composite’s definition are a set of raw metrics. These are accessed through the special function series() that takes two arguments, a metric name and one or many tag values wrapped in curly brackets ({}).

series("", {})

Either the metric name and/or the tag value may contain the wildcard character:

series("*", {"name":"prod.*"})

A dynamic tag may be specified for the tag value with %. This indicates that the tag(s) will be specified at the time the composite metric is loaded into a template instrument or dashboard:

series("*", "%")

As calls to series() are required in every composite definition a special shorthand notation s() will be an alias to the series() function:

sum(s("*", {"name":"prod.*"}))

The options map may be included with any of the following keys:

  • function - Specifies which summary statistic should be used. Accepted values are: min, max, mean, sum, count. The default function, if not specified, is mean.
  • period - Specifies the interval to which returned measurements should be summarized. All measurements within each period are summarized to a single measurement and the measure_time is floored to the period. This allows you to specify granularity that is not available at the standard rollup resolutions (1s, 60s, 900s, 3600s).
sum(s("*", {"name":"prod.*"}, { period:"100", function:"mean" }))