Use {{.Group}} in Chronograf-Alert-Overview when running with group by

chronograf
kapacitor
#1

Hello,

I just configured some Deadman-checks in Chronograf with GroupBy.

The problem is that in the alert-overview the “name” does not include the tag ‘server’, so all alerts from that rule look the same.

The TickScript for that rule looks like:

var db = 'monitoring'

var rp = 'autogen'

var measurement = 'docker_container_cpu'

var groupBy = ['datacenter', 'com.docker.swarm.service.name']

var whereFilter = lambda: "com.gitlab.gitlab-runner.job.id" !~ /./

var period = 3m

0s

var name = 'docker service deadmen'

var idVar = name + ':{{.Group}}'

var message = 'deadman for {{.Group}} at {{.Time}} seems {{.Level}}'

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)
        .log('/tmp/group.log')
        .pushover()

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')

How can I define the

var name =

to use the {{.Group}} within?

//edited: wrong picture removed. script fixed.