influxdata / influxdata/kapacitor
Possible bug with windows and httpout
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi
When i setup a rule which uses windowed data by tick script OR via chronograf my httpOu do not fire.
Here is an example:
`
var db = 'telegraf'
var rp = 'autogen'
var measurement = 'win_cpu'
var groupBy = ['brand', 'host']
var whereFilter = lambda: TRUE
var period = 30m0s
var every = 10m
var name = 'Windows - Report high cpu usage'
var idVar = name + ':{{.Group}}'
var message = '{{ index .Tags "brand" }} - {{ index .Tags "host" }} has been using more than 95% of its cpu for more than 30 minutes.'
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 = 95
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|window()
.period(period)
.every(every)
.align()
|max('Percent_Processor_Time')
.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://XXXXXX')
trigger
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)
trigger
|httpOut('output')
`
httpOut is never fired.
This happens everytime i set up a window, if i drop the window i get my alerts via httpOut as expected.
I tried this locally and using https://requestb.in/ to ensure it was not just my parsing/endpoint causing the issue.
Im relative new to TICK so this might be an error on my behalf but right now it looks like a bug.
Hope you can help as windows make alarming much more realiable :).
Contributor guide
Research direction
Reproduce the supplied TICKscript with and without window(), comparing the alert's httpOut('output') behavior and the influxDBOut() result. Start by tracing the window() and httpOut() execution paths; done means windowed alerts reliably fire the HTTP output while preserving the reported behavior without a window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100