Aggregate over time to reduce time resolution:
  • REDUCE_NONE ALIGN_MEAN 600s - downsample each timeseries by computing the 10-minute average
  • REDUCE_NONE ALIGN_MAX 3600s - downsample each timeseries by computing the hourly maximum
Aggregate across multiple time series (you can additionally use Group By feature if needed):
  • REDUCE_PERCENTILE_95 ALIGN_INTERPOLATE 60s - calculate the 95th percentile value among many timeseries
  • REDUCE_MEAN ALIGN_INTERPOLATE 60s - calculate the average value among many timeseries
Transform a counter to a metric representing rate (delta per second):
  • REDUCE_NONE ALIGN_RATE 60s - transform each timeseries by computing the rate of change (normalized to per second) over 60s intervals
Alias replacement variables:
  • {{metric.key1.key2}}
  • {{resource.key1.key2}}
Alias substitute function:
  • sub(metric.key1.key2, "regex", "newval")
  • sub(resource.key1, "(reg)(ex)", "$1$2")
Examples:
  • Server {{metric.labels.instance_name}}
  • {{resource.type}} - {{metric.type}}
  • sub(metric.type, ".*cpu/(.*)", "$1")
Show only subset of timeseries matching the query.

Examples:
  • AVERAGE TOP 10 - limit to top 10 series ordered by average series value
  • MIN ABOVE 2300 - show only series with min datapoint above 2300