influxdata / influxdata/kapacitor
Different alerts per state
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi,
I would like to have different behavior per state.
**Example**
Let's say that I have a tick script for CPU usage.
I want to send a HipChat notification for every WARN level reports, and I want to send both HipChat notification and an Email for CRIT level reports.
Can I do this from the same tick script?
Also, I would like to log every entry to a file/influxDBOut, and I want to report sate changes only to HipChat and mail. I know that there is the `.stateChangeOnly()` function, but is there a way to activate it for certain destinations only?
Here is a basic tick script that does not act like I would like it to:
```
stream
|from()
.measurement('cpu')
|window()
.period(5m)
.every(1m)
|alert()
.crit(lambda: "load" > 80)
.warn(lambda: "load" > 60)
.hipChat()
.email('test@test.com')
|influxDBOut()
.database('serverStatus')
.retentionPolicy('autogen')
.measurement('cpuStatus')
```
Thanks!
Contributor guide
Research direction
Start with the alert() and stateChangeOnly() behavior described in the issue, then trace how hipChat(), email(), and influxDBOut() are handled in a TICK script. Done means WARN and CRIT levels can use different destinations while logging continues for every entry and state-change-only behavior can be limited to selected destinations.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100