You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I have a strange problem with the deadman type alert. I defined a groupby condition on a tag that by the time the script is deployed the data hasn't arrived yet, so a "nil" error is thrown. Is there a way to ignore when the bucket is empty and not throw this kind of error?
This is the current script:
var db = 'test-db'
var rp = 'test-rp'
var measurement = 'my-test'
var groupBy = ['unique-field']
var whereFilter = lambda: ("condition" == 'false') AND ("description" == 'my-desc')
var period = 1m
var name = 'Dead-unique'
var idVar = name + '-{{.Group}}'
var message = ''
var idTag = 'alertID'
var levelTag = 'level'
var messageField = 'message'
var durationField = 'duration'
var outputDB = 'alarms-db'
var outputRP = 'alarms-rp'
var outputMeasurement = 'alerts'
var triggerType = 'deadman'
var threshold = 0.0
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
var trigger = data
|deadman(threshold, period)
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.stateChangesOnly()
trigger
|eval(lambda: "emitted")
.as('value')
.keep('value', messageField, durationField)
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)
trigger
|httpOut('output')
Hi all, I have a strange problem with the deadman type alert. I defined a groupby condition on a tag that by the time the script is deployed the data hasn't arrived yet, so a "nil" error is thrown. Is there a way to ignore when the bucket is empty and not throw this kind of error?
This is the current script:
and this is the error with nil value:
The text was updated successfully, but these errors were encountered: