Hi,
I created a test stream alert, I can see from the alert history that it is triggered every 5 seconds, but the end point only catches the http out post every 3 minutes. Is is designed this way? Can I get the httpout post in real time?
the TICK script is below for reference.
`var db = 'telegraf'
var rp = 'autogen'
var measurement = 'cpu'
var groupBy = []
var whereFilter = lambda: ("host" == 'iZtv1mmaqjxwusZ')
var name = 'test httpout'
var idVar = name + ':{{.Group}}'
var message = '123'
var idTag = 'alertID'
var levelTag = 'level'
var messageField = 'message'
var durationField = 'duration'
var outputDB = 'chronograf'
var outputRP = 'autogen'
var outputMeasurement = 'alerts'
var triggerType = 'threshold'
var crit = 90
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|eval(lambda: "usage_idle")
.as('value')
var trigger = data
|alert()
.crit(lambda: "value" > crit)
.stateChangesOnly()
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.post('http://localhost:9000/api/alerts/getChronografAlert')
Hi, I created a test stream alert, I can see from the alert history that it is triggered every 5 seconds, but the end point only catches the http out post every 3 minutes. Is is designed this way? Can I get the httpout post in real time?
the TICK script is below for reference.
`var db = 'telegraf'
var rp = 'autogen'
var measurement = 'cpu'
var groupBy = []
var whereFilter = lambda: ("host" == 'iZtv1mmaqjxwusZ')
var name = 'test httpout'
var idVar = name + ':{{.Group}}'
var message = '123'
var idTag = 'alertID'
var levelTag = 'level'
var messageField = 'message'
var durationField = 'duration'
var outputDB = 'chronograf'
var outputRP = 'autogen'
var outputMeasurement = 'alerts'
var triggerType = 'threshold'
var crit = 90
var data = stream |from() .database(db) .retentionPolicy(rp) .measurement(measurement) .groupBy(groupBy) .where(whereFilter) |eval(lambda: "usage_idle") .as('value')
var trigger = data |alert() .crit(lambda: "value" > crit) .stateChangesOnly() .message(message) .id(idVar) .idTag(idTag) .levelTag(levelTag) .messageField(messageField) .durationField(durationField) .post('http://localhost:9000/api/alerts/getChronografAlert')
trigger |influxDBOut() .create() .database(outputDB) .retentionPolicy(outputRP) .measurement(outputMeasurement) .tag('alertName', name) .tag('triggerType', triggerType)
trigger |httpOut('output')`