influxdata / influxdata/kapacitor
[proposed Label Bug] Holt_Winter issue with Group By
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi All,
I am trying to create an alert with holt_winter function but get an issue when I am trying to add a Group By clause.
I tried to add it also in the influx query as I found that same issue on Github for another function but get the same message :
[root@th2-grafana-01 kapacitor]# kapacitor define hwinterdrop2g -type batch -tick hwinter_drop2g.tick
failed to parse InfluxQL query: holt_winters aggregate requires a GROUP BY interval
Below the tick code:
dbrp "mobile"."1d"
var predicted = batch
|query('select holt_winters(max(call_drops_on_traffic_channel),1,7) FROM mobile."1d".cellule2g where time >=now()-30d and timenow()- 2d GROUP BY time(1d),nom_objet fill(0)')
.every(1m)
.groupBy(time(1d),'nom_objet')
|log()
|last('max')
.as('value')
|log()
predicted
|join(current)
.as('predicted','current')
|log()
|alert()
.crit(lambda: ("predicted.value"-"current.value")/"predicted.value"<-0.2)
|log()
|influxDBOut()
.create()
.database('alerts')
.measurement('gsm')
.tag('name','kpi')
Contributor guide
Research direction
Start by reproducing the kapacitor define command with the provided tick code and the holt_winters query containing GROUP BY time(1d),nom_objet. Trace how that query is parsed and determine why the GROUP BY interval is rejected; done when the alert definition parses successfully with the requested grouping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- backend, data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100