Deadman checks - group-by functionality?

Hi, all

I’m experimenting with the deadman checks in InfluxDB 2, and I was wondering about the current implementation of the deadman checks.

In Influx v1, we can use the following in a TICKscript to query with a groupby-:

var data = stream
    |from()
        .retentionPolicy(rp)
        .measurement('uptime')
        .groupBy(['host'])

Is there something similar in Influx v2?

My deadman checks don’t seem to trigger when one of N instances in a given query-check have gone “offline” (e.g. not submitting data for the last 60 seconds). It seems that only when the entire measurement/field hasn’t reported data will the check trigger.

@genux That should be possible using the group function in Flux.

My guess is you need to do something like this:

import "influxdata/influxdb/monitor"
import "experimental"
from(bucket: "telegraf")
  |> range(start: -2m)
  |> filter(fn: (r) => r._measurement == "system" and r._field == "uptime")
  |> group(columns:["host"])
  |> monitor.deadman(t: experimental.subDuration(from:now(), d:1m))

Hope that helps!