influxdata / influxdata/kapacitor
Kapacitor Alert
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Test message Alert from kapacitor to slack, alerta and more is good working.
But with trigger not working.
Influx 2.0.3
Kapacitor OSS 1.5.8
This my tickscripts.
```
var db = 'hosts'
var rp = 'autogen'
var measurement = 'system'
var groupBy = []
var whereFilter = lambda: ("host" == 'test-backup') AND isPresent("load1")
var name = 'test08'
var idVar = name
var message = ' TEST08 {{.Name}} {{.ID}} {{ index .Fields "value" }} {{.Fields}} {{.Level}}'
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 = 1
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|eval(lambda: "load1")
.as('value')
var trigger = data
|alert()
.crit(lambda: "value" > crit)
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.stateChangesOnly()
.slack()
.channel('#zabbix')
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')
```
If I get var triggerType = 'deadmen', alerts is working.
Restart kapacitor have error:
ts=2021-02-12T13:21:49.285+03:00 lvl=error msg="failed to create database" service=kapacitor task_master=main task=test08 node=influxdb_out5 err="not implemented: CREATE DATABASE" database=chronograf cluster=
Contributor guide
Research direction
Start with the supplied TICKscript, comparing the threshold trigger configuration with the working deadmen variant, and review the Kapacitor restart error about CREATE DATABASE for chronograf. Before changing code, establish the expected threshold behavior and a reproducible result; done should include a confirmed explanation and a validated correction or documented limitation.
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
- 25/100