influxdata / influxdata/kapacitor
Kapacitor does not produce alert log file
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi All,
I am new to the influxdb/kapacitor, so any help would be great! I have a simple tick file ver1.tick:
+++++++++++++++++++++++++++++++++++++
var data = batch
|query('''
select "name", "Pmerabestabsuccadded"
from "kpi_store"."autogen"."cell_ARKANSAS"
where "name" = 'ARL01128_9C_1' and "Pmerabestabsuccadded" = 2
''')
.period(30d)
.every(15m)
|alert()
.message('Cell sleeping')
.info(lambda: "Pmerabestabsuccadded" == 2)
.log('/tmp/alerts_auto_2.log')
++++++++++++++++++++++++++++++++++++++++
The task is enabled and running, if I ran "kapacitor show ver1":
ID: ver1
Error:
Template:
Type: batch
Status: enabled
Executing: true
Created: 20 Mar 18 01:18 UTC
Modified: 20 Mar 18 01:53 UTC
LastEnabled: 20 Mar 18 01:53 UTC
Databases Retention Policies: ["kpi_store"."autogen"]
TICKscript:
var db = 'kpi_store'
var rp = 'autogen'
var data = batch
|query('''
select "name", "Pmerabestabsuccadded"
from "kpi_store"."autogen"."cell_ARKANSAS"
where "name" = 'ARL01128_9C_1' and "Pmerabestabsuccadded" = 2
''')
.period(30d)
.every(15m)
|alert()
.message('Cell sleeping')
.info(lambda: "Pmerabestabsuccadded" == 2)
.log('/tmp/alerts_auto_2.log')
DOT:
digraph ver1 {
graph [throughput="0.00 batches/s"];
query1 [avg_exec_time_ns="0s" batches_queried="2" errors="0" points_queried="50" working_cardinality="0" ];
query1 -> alert2 [processed="2"];
alert2 [alerts_triggered="2" avg_exec_time_ns="0s" crits_triggered="0" errors="0" infos_triggered="2" oks_triggered="0" warns_triggered="0" working_cardinality="1" ];
}
==============================
from "alert2", it seems that some alerts are triggered. However, I just cannot see the log file in /tmp/alerts_auto_2.log. Can anyone pls help me? Thanks!
Contributor guide
Research direction
Start with ver1.tick and the kapacitor show ver1 output, focusing on the alert node's .log destination and the task's runtime context. Verify how alert logs are expected to be written and where the running task can access /tmp; done when the triggered alerts produce the requested log file or the failure is reported clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100