influxdata / influxdata/kapacitor
The recovery alarm is not sent when there is no data in the corresponding window on streaming mode.
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Question:
The recovery alarm is not sent when there is no data in the corresponding window on streaming mode.

This is the phenomenon and my expectation.
```
2021-08-03 07:16:00 6
2021-08-03 07:17:00 5
2021-08-03 07:18:00 21 // Triggered crit alarm
2021-08-03 07:19:00 // Expect to trigger a recovery message but no. This point no data.
2021-08-03 07:20:00
```
Does Kapacitor support this alarm? What should I do?
This is Ticksscript.
```
var db = 'node'
var rp = 'autogen'
var measurement = 'errors'
var groupBy = ['app']
var period = 1m
var every = 1m
var name = 'SSR error'
var idVar = 'SSR error {{.Group}}'
var message = 'SSR error alarm. value :{{ index .Fields "value" | printf "%0.2f"}}, rule: >= 10.00 '
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 data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
|window()
.period(period)
.every(every)
.align()
|sum('count')
.as('value')
|log()
var trigger = data
|alert()
.crit(lambda: "value" >= 10.0)
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.post('http://xxx')
trigger
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)
```
Contributor guide
Research direction
Start by reproducing the reported TickScript with streaming input, one-minute aligned windows, and a missing-data interval after a critical value. Check whether the alert stream emits a recovery event for an empty window; done means the expected recovery message is sent or the supported behavior is documented.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability, stream-processing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100