influxdata / influxdata/kapacitor
Alert not triggered multiple times
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi,
Kapacitor OSS 1.5.3
Influxdb-Version: 1.8.0
I'm collecting SNMP TRAPs via Telegraf and want to send out an alert whenever a trap is sent which has certain oid's/values, but for now I'm just trying to get it to send an alert on any trap received.
These traps arrive from different devices/manufacturers
However, I'm only getting an alert sent on the first trap and none on any subsequent traps. I've tried both batch and stream with the same results. Data does show up in the log.
stream:
```
var data = stream
|from()
.measurement('snmp_trap')
data
|log()
.level('DEBUG')
data
|alert()
.id('{{ .TaskName }}')
.message('TRAP {{ .ID }}')
.warn(lambda: 1 == 1)
.details('''
{{ .ID }}
{{ .Time }}
{{ .Fields }}
{{ .Tags }}
''')
.email()
.slack()
```
batch
```
var traps = batch
|query('SELECT * FROM "telegraf"."autogen"."snmp_trap"')
.period(1m)
.every(1m)
.groupBy(*)
|log()
|alert()
.id('{{ .TaskName }}')
.warn(lambda: 1 == 1)
.message('TRAP {{ .ID }}')
.details('''
{{ .ID }}
{{ .Time }}
{{ .Fields }}
{{ .Tags }}
''')
.email()
|log()
```
I have tried adding `.Time` to the id to sort of randomize the id, but that didn't work. Is there any way to randomize the ID or another way always send out alerts no matter previous state?
Contributor guide
Research direction
Start with the Kapacitor alert node behavior using the supplied stream and batch task definitions, and reproduce the issue with repeated SNMP trap points. Compare the alert ID, warning condition, and resulting state across successive events; done means the supported behavior for repeated alerts is established and verified against the reported configurations.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100