influxdata / influxdata/kapacitor
httppost is not working with kapacitor
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Task is not posting alert to endpoint, Please help me out.
I am using kapacitor image with remote influxdb.
kapacitor log as below:
`ts=2019-05-09T17:27:50.613Z lvl=info msg="http request" service=http host=172.31.48.5 username=- start=2019-05-09T17:27:50.603889344Z method=POST uri=/write?consistency=&db=_internal&precision=ns&rp=monitor protocol=HTTP/1.1 status=204 referer=- user-agent=InfluxDBClient request-id=c52dd47b-727f-11e9-ae89-000000000000 duration=9.632055ms
`
All my app in same VPC and able to ping perfectly.
In kapacitot config I have added influxdb details and httppost as endpoint.
kapacitor task as below:
$ kapacitor show TASK_ID
```
ID: 2f9f19f8-9ad8-4e8e-ac20-a0317952fce1
Error:
Template: utilization
Type: stream
Status: enabled
Executing: true
Created: 08 May 19 15:43 UTC
Modified: 08 May 19 15:43 UTC
LastEnabled: 08 May 19 15:43 UTC
Databases Retention Policies: ["meros_customers"."autogen"]
TICKscript:
var measurement string
var auth_token string
var where_filter = lambda: TRUE
var groups = [*]
var field string
var warn lambda
var crit lambda
var window = 1m
var to_user_email string
var message string
var kapacitor_alerts_endpoint string
stream
|from()
.measurement(measurement)
.where(where_filter)
.groupBy(groups)
|window()
.period(window)
.every(window)
|mean(field)
|alert()
.details('{{.TaskName}}')
.warn(warn)
.crit(crit)
.message(message)
.email(to_user_email)
.post(kapacitor_alerts_endpoint)
.header('authorization', auth_token)
.captureResponse()
.timeout(10s)
Vars:
Name Type Value
auth_token string Token token=ae3bf7ef59ec4e41239898c74bc5e2d496f
crit lambda "mean" > 4
field string user
groups list []
kapacitor_alerts_endpoint string https://cmpcm.concertocloud.com/v1/account/kapacitor/alerts
measurement string host-cpu
message string ip-172-31-41-250 prod test
to_user_email string udayonrails@gmail.com
warn lambda "mean" > 3
where_filter lambda "account" == '94cb8bad-ac4e-40dd-8d96-9f24f11ce751' AND ( "host" == 'ec2bf88d-4806-a9ea-1922-0a49ef4331e4')
window duration 1m0s
DOT:
digraph 2f9f19f8-9ad8-4e8e-ac20-a0317952fce1 {
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_inhibited="0" 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" ];
}
```
Contributor guide
Research direction
Start with the shown Kapacitor task and its alert().post(), .header(), and .captureResponse() settings, then compare them with the provided Kapacitor log. Reproduce the task using the listed endpoint and remote InfluxDB configuration. Done means identifying the cause of the missing alert POST and confirming the behavior with a documented or tested resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100