influxdata / influxdata/kapacitor

No alerts are being triggered

Open
#2,392 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

Hello everyone!

I've just added a kapacitor to our chronograf and the test alert to slack works perfectly.
Now I tried to set up an alarm, but sadly there is no alarm being triggered, even tho they are enabled and the 'check' reached the critical number.
I've also added 'log' as an additional event handler so I'd know if slack is making problems (for any reason).

This is my tick script:
```
var db = 'telegraf'
var rp = 'autogen'
var measurement = 'processes'
var groupBy = []
var whereFilter = lambda: ("host" == 'i-014315a23a22d3bce')
var period = 10s
var every = 30s
var name = 'Test'
var idVar = name
var message = 'Test'
var idTag = 'alertID'
var levelTag = 'level'
var messageField = 'message'
var durationField = 'duration'
var outputDB = 'chronograf'
var outputRP = 'autogen'
var outputMeasurement = 'alerts'
var triggerType = 'threshold'
var crit = 88

var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|window()
.period(period)
.every(every)
.align()
|last('total')
.as('value')

var trigger = data
|alert()
.crit(lambda: "value" > crit)
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.log('/tmp/slack.log')
.slack()
.channel('#michis-project')
.username('Test')
.iconEmoji(':thumbsup:')

trigger
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)

trigger
|httpOut('output')
```

I have no idea on why there is no alert being triggered.. can someone help me?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied TICK script with the stated Kapacitor, Chronograf, Slack, and InfluxDB setup, then inspect alert and log output around the threshold. The report names no repository files or tests; done means identifying why the alert is not triggered and documenting a verified fix.

Written by the indexing model from the issue text.

Assessment

Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.