Filter out global deadman alerts



I have a deadman alert where I group the alerts by a “serial” code.

var data = stream
        .where(lambda: TRUE)

var trigger = data
    |deadman(0.0, 10m)
        .id('{{ index .Tags "sensorId" }}')


This works fine, however…I would like to not have it alert when I stop receiving measurements as a whole. Currently, if no measurements come through, it will send the alert but with “nil” values. I would like it to only send when the group itself doesn’t have any measurements coming through (usually when I just create the alert and it doesn’t have any memory yet). Is there a way to modify the query to filter out the “global” use case?