We have some Kapacitor tasks that were created for the telegraf database and autogen (default) retention policy:
ID Type Status Executing Databases and Retention Policies
cpu-alert stream enabled true ["telegraf"."autogen"]
disk-alert stream enabled true ["telegraf"."autogen"]
memory-alert stream enabled true ["telegraf"."autogen"]
These were working fine until someone created a new default retention policy:
> show retention policies on telegraf
name duration shardGroupDuration replicaN default
---- -------- ------------------ -------- -------
autogen 0s 168h0m0s 1 false
ninety_days 2160h0m0s 24h0m0s 1 true
Redefining these tasks with the new default retention policy gets them working again:
kapacitor define disk-alert -type stream -tick /etc/kapacitor/TICKfiles/disk.tick -dbrp telegraf.ninety_days
All well and good, but what is a best practice for keeping the default retention policy for the Kapacitor tasks in synch with the actual default retention policy? This will require a change to our Kapacitor startup script. No biggie, but is there really no way to define Kapacitor tasks, specifying that the default retention policy is desired, without having to actually spell out the name of default retention policy? That would seem to be the whole point of having a default.
I see there were efforts to replace “default” with “autogen” in the documentation when indicating the default retention policy, though the “kapacitor help define
” command still has a reference to “default”. In any case, I thought that specifying “default” for the retention policy in the -dbrp parameter value might actually cause the command to interpret the intention as being what the default retention policy actually is. But that’s apparently not the case. It really does appear to be interpreting the -dbrp value literally, because the tasks do not work when I do this.
There’s also no error message in the kapacitor.log file when I specify “-dbrp telegraf.default
” for the define command, even though there really isn’t a retention policy named “default”. There in fact is no error message for any invalid retention policies (e.g., “-dbrp telegraf.invalid
”), even with DEBUG level logging turned on for Kapacitor, so this was a very difficult problem to diagnose.
Thinking there may be an enhancement request and possible logging bug to report here, but I figured I would start with a post to the community page for now.
Alternatively, I realize that we could have also changed the autogen retention policy, and not created a new “ninety_days” policy. Then the Kapacitor tasks would have continued to work fine. That does not seem to be anything one could recommend as a “best practice”, however, since there are perfectly valid reasons for wanting to create new retention policies and defaults.
Thanks in advance for any help. We are running Kapacitor and InfluxDB Version 1.3.