influxdata / influxdata/kapacitor
Deadman is not working
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I am wondering if someone can point out my mistake.
I have a batch query, an alert and a deadman. The alert appears to work fine. The deadman however, fires all the time and I am receiving the alert email every day. It should only fire if no data has been received in a 24 hr period.
The TICKscript is as follows:
``` go
var location1 = batch
|query('SELECT mean("channel_batt") FROM "metrics"."default"."P123"')
.period(24h)
.every(24h)
.groupBy(time(24h))
location1
|alert()
.crit(lambda: "mean" < 3.30 )
.warn(lambda: "mean" < 3.50 )
.id('{{.Name}}')
.message('Battery is {{.Level}}, value: {{ index .Fields "mean" }}')
.details( '' )
.log('/var/log/kapacitor/battery_alerts.log')
.email()
location1
|eval(lambda: "mean").as( 'mean' )
|deadman(1.0, 24h)
.id('P123')
.message('{{ .ID }} is {{ if eq .Level "OK" }}alive{{ else }}dead{{ end }}.')
.details( '{{ index .Fields "collected" }} points received in 24h.' )
.log('/var/log/kapacitor/deadman_alerts.log')
.email()
```
When I receive the email, there is nothing at the beginning of the details line in the email body. That is, you see the text " point received in 24h." There is no value (zero or otherwise) output for the number of points collected.
kapacitor 0.12.0
Influxdb is 0.10.1
Ideas?
Contributor guide
Research direction
No repository file or test is named. Start by reproducing the Kapacitor 0.12.0 TICKscript behavior with the batch query and deadman configuration, then inspect how the deadman alert populates the collected field and determine what change would make the 24-hour no-data condition and email details behave as described.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100