bundlewrap/data/grafana/flux.mako
mwiegand 84ecb460df wip
2021-07-04 18:09:50 +02:00

9 lines
377 B
Mako

from(bucket: "${bucket}")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["host"] == "${host}")
% for key, value in filters.items():
|> filter(fn: (r) => r["${key}"] == "${value}")
% endfor
|> filter(fn: (r) => r["_field"] == "${field}")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")