Previous: , Up: Datapoints and Transforms   [Contents]


6.4.2 sampling-transform

<transform plugin="sampling-transform">
  <window samples="10"/>   <!-- or duration="5m" -->
  <reduce>avg</reduce>     <!-- avg | min | max | median -->
  <mode>sliding</mode>     <!-- sliding | hold -->
</transform>
window samples="N"

Fixed-length sample window.

window duration="..."

Time window: 300, 300s, 5m, 1h. Requires mode=hold.

reduce

avg, min, max, or median.

mode

sliding (default) or hold.

mode=sliding

Reduce over a sliding window on every push; when full, drop the oldest sample.

mode=hold + samples

Reduce every N samples; hold the last reduced value between updates.

mode=hold + duration

Clock-aligned buckets. Emit when the first sample of a new bucket arrives. Failed reads do not shift the phase.

Tip: use sliding when rules should track a smooth live average; use hold when you want fewer updates (for example a 5-minute mean that only changes when the window completes).