influxdata / influxdata/kapacitor
alert on empty series
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi all 👋
I stumbled over a scenario where I'm emitting certain numbers from a few nodes and if their sum over a period of time goes to 0, alert.
However I would also like to alert, in this particular case, if there is simply zero data because my nodes are not emitting at all anymore. i.e. `if {"series":null}`.
I'm aware that there are limitations to this, e.g. we can't tell which tags that would infer (host, etc) but we really just need the alert if no data is emitted, no `group-by`s.
Scenario that will _almost_ do what I need:
```
stream
|from()
.measurement('indexer')
|window()
.period(5m)
.every(10s)
|default()
.field('processed_per_second', 0.0)
|sum('processed_per_second')
|httpOut('debug')
|alert()
```
This will work if `kapacitor` has seen the nodes emitting data before. But it will NOT work if I start kapacitor and there simply is no data (because maybe these nodes were down for quite a while); the `|httpOut()` gives me the aforementioned `{"series":null}` in this case, and I would like to alert then.
Thanks :)
Contributor guide
Research direction
Start by reproducing the stream → window → default → sum → httpOut → alert pipeline described in the issue, both after prior data and with no data after startup. Trace how an empty series is represented and handled by alert(). Done means an alert can be triggered for the no-data case without group-bys while preserving the existing zero-sum behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100