influxdata / influxdata/kapacitor
Not Able to override .details to PagerDutyV2
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
When Kapacitor sends to PagerDutyV2. It always sends the hard to read JSON. I am trying to override this with the .details() on the AlertNode but it does not seem to be taking. I have tried the example of .details in the docs and just a simple 'test' details and it doesn't seem to be taking.
`var measurement string
var groupBy = [*]
var whereFilter lambda
var name string
var field string
var crit int
var warn int
var message string
var timeInterval = 30s
var critcalEvaluation = lambda: "value" > crit
var warnEvaluation = lambda: "value" > warn
var topic = 'system'
var idVar = name + '-{{.Group}}'
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 data = stream
|from()
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|window()
.period(timeInterval)
.every(timeInterval)
|mean(field)
.as('value')
.quiet()
var trigger = data
|alert()
.crit(critcalEvaluation)
.warn(warnEvaluation)
.message(message)
.details('Test')
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.topic(topic)
trigger
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)`
Contributor guide
Research direction
Start with the supplied TICKscript, focusing on alert().details('Test') and the PagerDutyV2 notification path. Reproduce the alert and inspect the emitted PagerDuty payload; done means the configured details value is honored instead of the hard-to-read JSON.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100