Upgrading to Kapacitor v0.12

Warning! This page documents an old version of Kapacitor, which is no longer actively developed. Kapacitor v1.3 is the most recent stable version of Kapacitor.

There are a few breaking changes from v0.11 that may require some work to upgrade from a v0.11 instance. These changes are:

NOTE: The old .mapReduce syntax has been removed in this release.

TICKscript Chain Operator

To improve readability of TICKscripts we have added a new operator | to the language. Now instead of using .’s for every function chain you use | for chaining methods and . for property methods.

For example if before you had a script like:

stream
    .from()
        .measurement('m')
    .window()
        .period(10s)
        .every(10s)
    .count('value')
    .alert()
        .cirt(lambda: "count" < 10)
        .sensu()

Change all . operators for chaining methods to |s.

stream
    |from()
        .measurement('m')
    |window()
        .period(10s)
        .every(10s)
    |count('value')
    |alert()
        .cirt(lambda: "count" < 10)
        .sensu()

A special operator to call UDFs has also been added @. Before if you had a TICKscript that used a UDF named myCustomUDF like:

stream
    .from()
        .measurement('m')
    .window()
        .period(10s)
        .every(10s)
    .myCustomUDF()
        .field('value')
    .alert()
        .cirt(lambda: "count" < 10)
        .sensu()

Change it to:

stream
    |from()
        .measurement('m')
    |window()
        .period(10s)
        .every(10s)
    @myCustomUDF()
        .field('value')
    |alert()
        .cirt(lambda: "count" < 10)
        .sensu()

Now if someone shares a TICKscript with you and you see an @ operator you will know that you need their UDF as well to make it work. These changes improve readability of TICKscripts as it is clear what methods are branching and adding new nodes to the pipeline and which set properties.

With this change it is now possible to programatically format TICKscripts with a new command tickfmt. If you are a vim user see this plugin, for auto formatting and syntax highlighting.

Note: The old syntax will continue to function throughout the 0.12 release but will be removed for the 0.13 release.