Deadman Measurement Name

I’m trying to get the name of the measurement when sending a deadman alert. However {{.Name}} returns ‘stats’. Is there any way to get the actual name of the measurement? Thanks in advance.

Can you paste your alert rule code in a </> code block ?

var message = '*Task*: ' + name + '
*Time*: {{.Time}}
*Measurement*: {{.Name}}
*Details*: Indicator {{ if eq .Level "OK" }}exists {{ else }}missing {{end}}'

var data = stream
        .where(lambda: ("variable" == 'light_indicator'))

var trigger = data
	|deadman(threshold, period)

If your measurement name is set in your script something like

var measurement = 'your_measurement'

Then you should be able to concatenate that variable into your message, the same way as you have done with name.

var message = '*Task*: ' + name + '

For my case, I am not specifying the measurement property, so the measurement can change. Usually I can use {{.Name}} to determine it, but when used with deadman, “stats” is always returned as the measurement rather than the actual measurement name.

Sorry for the delay.

To be honest, I’m not sure how else to do it. I don;t know if you can use a wildcard somehow. I only tend to target a few specific measurements such windows services to check the agent is still running.

I try to avoid using deadman across everything - it can be…noisey