influxdata / influxdata/kapacitor
Move stream template to batch implementation
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I have a lot of tasks running that use a stream template. When I changed that stream template to fix some minor bugs, tasks were correctly updated to use the new template when restarted.
However when I tried to move the stream template to a batch implementation, kapacitor did not want to restart and gave me the following error:
> run: open server: failed to reload tasks/templates/handlers: failed to load file /opt/kapacitor/templates/sensor_boolean.tick: failed to create template: invalid TICKscript: name "batch" is undefined. Names in scope: time,stream,sensorId,alertDefinitionId,criticalValue
Looks like kapacitor does not allow moving from a stream template implementation to a batch template implementation. Is this a feature that is under consideration?
My workaround will be redefining all my tasks with the new batch-based template (which will live under a different name than the stream template). But this is hardly an ideal situation.
Contributor guide
Research direction
Start with the template reload path identified by tasks/templates/handlers and reproduce the failure using /opt/kapacitor/templates/sensor_boolean.tick, which currently reports an undefined batch name in TICKscript. Done means an existing task can be restarted after its template changes from stream to batch without requiring a separately named template.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100