influxdata / influxdata/kapacitor
Kapacitor cannot send alert
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Kapacitor and influxdb version : latest in docker hub
So I am testing alerting for system using Kapacitor, but it cannot write any alert into file log.
My Kapacitor's config:
`
[logging]
file = "/var/log/kapacitor/kapacitor.log"
level = "CRITICAL"
[[influxdb]]
enabled = true
default = true
name = "localhost"
urls = ["http://172.17.0.1:8086"]
username = ""
password = ""
timeout = 0
insecure-skip-verify = false
startup-timeout = "5m"
disable-subscriptions = false
subscription-mode = "cluster"
subscription-protocol = "http"
subscriptions-sync-interval = "1m0s"
kapacitor-hostname = ""
http-port = 0
udp-bind = ""
udp-buffer = 1000
udp-read-buffer = 0
[influxdb.subscriptions]
my_database = [ "default" ]`
My TICKscript:
`
ID: chronograf-v1-1e6206a2-5898-4434-9772-20736583a12a
Error:
Template:
Type: stream
Status: enabled
Executing: true
Created: 18 Apr 18 07:30 UTC
Modified: 18 Apr 18 08:21 UTC
LastEnabled: 18 Apr 18 08:21 UTC
Databases Retention Policies: ["zcloud"."autogen"]
TICKscript:
stream
|from()
.database('mydb')
.retentionPolicy('autogen')
.measurement('mymeasurement')
.groupBy(*)
|window()
.period(10s)
.every(10s)
.align()
|mean('wind_speed')
.as('value')
|alert()
.warn(lambda: "value" >= 7.5)
.warnReset(lambda: "usage_idle" < 7.5)
.message(' {{.ID}}')
.log('/tmp/alerts.log')
DOT:
digraph chronograf-v1-1e6206a2-5898-4434-9772-20736583a12a {
graph [throughput="0.00 points/s"];
stream0 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
stream0 -> from1 [processed="0"];
from1 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
from1 -> window2 [processed="0"];
window2 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
window2 -> mean3 [processed="0"];
mean3 [avg_exec_time_ns="0s" errors="0" working_cardinality="0" ];
mean3 -> alert4 [processed="0"];
alert4 [alerts_triggered="0" avg_exec_time_ns="0s" crits_triggered="0"
errors="0" infos_triggered="0" oks_triggered="0" warns_triggered="0"
working_cardinality="0" ];
}`
My influx's subscriptions:
`
> show subscriptions
name: _internal
retention_policy name mode destinations
---------------- ---- ---- ------------
monitor kapacitor-25336acf-a3d2-4a7b-b382-fbeabc97eb61 ANY [http://ab0221805079:9092]
monitor kapacitor-fe287e2d-ac2d-46c2-8d95-10c9ae2719f4 ANY [http://ab0221805079:9092]
name: mydb
retention_policy name mode destinations
---------------- ---- ---- ------------
autogen kapacitor-25336acf-a3d2-4a7b-b382-fbeabc97eb61 ANY [http://ab0221805079:9092]
autogen kapacitor-fe287e2d-ac2d-46c2-8d95-10c9ae2719f4 ANY [http://ab0221805079:9092]
name: chronograf
retention_policy name mode destinations
---------------- ---- ---- ------------
autogen kapacitor-fe287e2d-ac2d-46c2-8d95-10c9ae2719f4 ANY [http://ab0221805079:9092]
`
Contributor guide
Research direction
Start with the Kapacitor configuration, TICKscript, and InfluxDB subscription output in the issue. Check why the task graph shows zero processed points and zero alerts, then verify that a triggered alert is written to /tmp/alerts.log; done means the alert pipeline processes data and produces the expected log entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100