How to compute a rate while rejecting jumps


I would like to monitor and raise an alert when the filling rate of a disk/partition is above the limit

I have modified the default rule for disk fill rate this way:

template: disk_fill_rate_alarm
      os: linux freebsd
   hosts: *
families: /var
  lookup: min -10m at -60m unaligned of avail
    calc: ($this - $avail) / (($now - $after) / 3600)
   every: 1m
   units: GB/hour
    warn: $this > (($status >= $WARNING)  ? (40e-3): (50e-3))
    info: average rate the disk fills up (positive) for the last hour

The problem is that whenever the disk has filled a bit and an administrator removes some log files, the alarm does not work because the comparison is performed with the status one hour ago.

What I would like is a way to recompute the rate by summing the differences of avail between consecutive values, rejecting big negative jumps and summing them back.

Relevant docs you followed/actions you took to solve the issue

The grouping methods described in Database queries/lookup | Learn Netdata does not allow the specific processing I’m looking for. It seems there’s no way to design a custom grouping method.

Environment/Browser/Agent’s version etc

netdata_1.33.1 on ubuntu

What I expected to happen

An integrated grouping method “rate” with optional rejection parameters. Or a way to design a custom grouping.