Kapacitor gets data, but does not go through alert
Hello,
I am running Kapacitor 1.1 beta (nightly build) - had the same issue with 0.13 and 1.0 beta.
So, my setup is the following: influxDB-relay is sending data to Kapacitor as well as to my influxDB instances.
I know that Kapacitor gets the data, thanks to stats ingress command:
[httpd] 127.0.0.1 - - [29/Jun/2016:20:59:33 +0000] "GET /kapacitor/v1/debug/vars HTTP/1.1" 200 2354 "-" "KapacitorClient" 61777bb7-3e3c-11e6-805f-000000000000 5224
Database Retention Policy Measurement Points Received
alaloop daily2 16
_kapacitor autogen runtime 20
alaloop indexes 16
_kapacitor autogen edges 160
alaloop monthly2 16
alaloop hourly2 16
_kapacitor autogen ingress 189
_kapacitor autogen kapacitor 20
_kapacitor autogen nodes 120
alaloop instant2 16
(notice that Retention Policy for my DB ('alaloop') is left blank - issue with influxDB-relay ? misconfiguration ?)
I have defined the following, simple task:
[httpd] 127.0.0.1 - - [29/Jun/2016:21:00:27 +0000] "GET /kapacitor/v1/tasks/test?dot-view=attributes&replay-id=&script-format=formatted HTTP/1.1" 200 611 "-" "KapacitorClient" 81e0b91f-3e3c-11e6-8060-000000000000 1241
ID: test
Error:
Template:
Type: stream
Status: enabled
Executng: true
Created: 29 Jun 16 20:42 UTC
Modified: 29 Jun 16 20:42 UTC
LastEnabled: 29 Jun 16 20:42 UTC
Databases Retenton Policies: ["alaloop"."default"]
TICKscript:
stream
|from()
.measurement('instant2')
|alert()
.crit(lambda: "value" > 1)
// Whenever we get an alert write it to a file.
.log('/tmp/alerts.log')
DOT:
digraph test {
graph [throughput="0.00 points/s"];
stream0 [avg_exec_time_ns="0" ];
stream0 -> from1 [processed="0"];
from1 [avg_exec_time_ns="0" ];
from1 -> alert2 [processed="0"];
alert2 [alerts_triggered="0" avg_exec_time_ns="0" crits_triggered="0" infos_triggered="0" oks_triggered="0" warns_triggered="0" ];
}
Notice that no data flow through this task, despite this measurement "instant2" is present in stats ingress command.
Ok, found the issue.
For some reason, the conf file of my influxDB-relay did not contain the following line: default-retention-policy = "default"
Adding it and restarting the service resulted in kapacitor receiving the expected data, as per stats ingress:
[httpd] 127.0.0.1 - - [29/Jun/2016:21:30:34 +0000] "GET /kapacitor/v1/debug/vars HTTP/1.1" 200 2359 "-" "KapacitorClient" b6888354-3e40-11e6-8045-000000000000 5181
Database Retention Policy Measurement Points Received
alaloop default daily2 12
_kapacitor autogen runtime 16
alaloop default instant2 12
_kapacitor autogen ingress 134
_kapacitor autogen kapacitor 16
_kapacitor autogen nodes 96
alaloop default indexes 12
_kapacitor autogen edges 128
alaloop default hourly2 12
alaloop default monthly2 12