influxdata / influxdata/kapacitor
Alerts not triggered
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I get following error when creating an Kapacitor alert. Alert is created but not triggered afterwards.
`lvl=error msg="failed to create database" service=kapacitor task_master=main task=chronograf-v1-2004f027-091f-4af9-b5c8-a636ab28fcc8 node=influxdb_out8 err="retention policy conflicts with an existing policy" database=chronograf cluster=`
Alert definition is:
```
var db = 'telemetrics'
var rp = 'two_months'
var measurement = 'system'
var groupBy = []
var whereFilter = lambda: ("host" == 'hostname.domain.xxxx')
var period = 1m
0s
var name = 'Redis Deadman'
var idVar = name + ':{{.Group}}'
var message = 'DEADMAN Alert REDIS.'
var idTag = 'alertID'
var levelTag = 'level'
var messageField = 'message'
var durationField = 'duration'
var outputDB = 'chronograf'
var outputRP = 'autogen'
var outputMeasurement = 'alerts'
var triggerType = 'deadman'
var threshold = 0.0
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
var trigger = data
|deadman(threshold, period)
.stateChangesOnly()
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.telegram()
.chatId('-232933442')
.log('/var/log/kapacitor/alerts.log')
trigger
|eval(lambda: "emitted")
.as('value')
.keep('value', messageField, durationField)
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)
trigger
|httpOut('output')
```
Kapacitor OSS 1.5.1 (git: HEAD 89828ffff6cf5cd4cb2b34bf883e134395f734de)
InfluxDB shell version: 1.7.1
Chronograf 1.7.3 (git: 149a4253db08dd45710a4718e506e24544961eec)
Can you suggest solution to this, please?
Contributor guide
Research direction
No source file, test, or entry point is named. Start by reproducing the alert definition against the stated Kapacitor and InfluxDB versions, then trace the influxDBOut create path and its retention-policy error. Done means the cause of the failed alert creation is identified and a verified correction or clear limitation is documented.
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
- 18/100