influxdata / influxdata/kapacitor

Move stream template to batch implementation

Open
#1,945 0 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.