We are in the process of implementing TICK as a replacement for our current monitoring platform and still getting our feet wet, so bare with me
We are going to leverage Alerta as our event console so we will send any Kapacitor alerts there for distribution and everything works fine with the integration unless I try to expose the details property to Alerta. We populate that property in the alert with an internal URL that has run book info in it for the on-call engineer to reference as part of our incident management process so would prefer to have this flow into Alerta, but when I configure it that way, I am getting the following in the kapacitor log
ts=2019-01-07T22:35:04.328Z lvl=error msg="failed to evaluate Alerta template" service=alerta handler=alerta topic=services err="template: value:1:3: executing \"value\" at <.Details>: can't evaluate field Details in type alert.TemplateData" value="{{ .Details }}"
The config for our topic handler for alerta looks like this:
topic: services id: alerta kind: alerta options: resource: '{{ .Name }}' event: '{{ .ID }}' environment: '{{ index .Tags "env"}}' group: '{{ .Group }}' origin: 'kapacitor' value: '{{ .Details }}' service: ['Pinger Service']
A typical alert looks like this
`var limit = 1
var escalations = 2
dbrp ātelegrafā.āautogenā
var data = stream
|from()
.measurement(āabuseā)
|window()
.period(30s)
.every(30s)
|mean(āhard_blockā)
.as(āblocksā)
|derivative(āblocksā)
.nonNegative()
.unit(1s)
.as(āblocked_rateā)
|stateCount(lambda: āblocked_rateā > limit)
.as(ācountā)
|log()
data
|alert()
.stateChangesOnly()
.id(āToo many hard blocked accountsā)
.message(ā{{ .Level }} alert: {{ .ID }}: current value {{ index .Fields āblocked_rateā | printf ā%0.2fā }}ā)
.details(āāāhttp://redactedDomainNameHere/display/Ops/Alerts#Alerts-Toomanyhardblockedaccountsāāā)
.crit(lambda: ācountā > escalations)
.topic(āservicesā)
`
If I change the topic handler to pass in something like {{ .ID }} or {{ .Message }} as the value option it works, so not sure what Iām doing wrong or if Iām just misunderstanding whether or not itās possible to pass in the details property to Alerta.
We are running the following versions:
InfluxDB - 1.7.1 (OSS)
Kapacitor - 1.5.1
Any help would be greatly appreciated