Kapacitor not triggring relative alert

I created a realative alert which should trigger when current value - past value >15.
But I am not getting any alert. Threshold and deadman alert are working fine. I have tried almost several conditions that should have resulted in alert but wasn’t successful.

var db = ‘ashish’

var rp = ‘autogen’

var measurement = ‘test3’

var groupBy =

var whereFilter = lambda: TRUE

var name = ‘test3 alert’

var idVar = name

var message = ‘test 3 alert’

var idTag = ‘alertID’

var levelTag = ‘level’

var messageField = ‘message’

var durationField = ‘duration’

var outputDB = ‘chronograf’

var outputRP = ‘autogen’

var outputMeasurement = ‘alerts’

var triggerType = ‘relative’

var shift = 1m


var crit = 15

var data = stream
|eval(lambda: “new”)

var past = data

var current = data

var trigger = past
.as(‘past’, ‘current’)
|eval(lambda: float(“current.value” - “past.value”))
.crit(lambda: “value” > crit)

|eval(lambda: float(“value”))
.tag(‘alertName’, name)
.tag(‘triggerType’, triggerType)


I had the same problem, it turned out join is not working if there is some irregularity in timestamps, using tolerance should help:

var trigger = past
.as(‘past’, ‘current’)

see also: https://github.com/influxdata/chronograf/issues/2011