Kapacitor: using other data from source measurement window



In the capacitor alert node, to construct a meaningful message. If I don’t use an aggregate or selector like mean, for example like this:

         .id('{{ .TaskName }}/{{ .Name }}/{{index .Tags "role"}}/instance: {{index .Tags "instance_id"}}')
         .message('{{ .ID }} is at {{ .Level }}  has {{ index .Fields "available_percent" }}% of memory available on role: {{ index .Tags "role" }}, on instance {{ index .Tags "instance_id" }}. There is {{ index .Fields "available" }}Mb out of {{ index .Fields "total" }}Mb')
         .crit(lambda: "available_percent" > 1.0)

I can get access to the other values. However, If I want say the mean over my window, I can’t see how to get this.
I hoped I could ask for the mean of the stat that I want and then the mean of the other fields, and reference those, for e.g.


but, chaining ‘mean’ doesn’t really make sense, and using ‘show’ I can see errors on the 2nd node, which might be expected.

Any hints?


also, forgive me for not picking up autocorrect’s s/kapacitor/capacitor/ above


@glenndavy Have a look at the join node https://docs.influxdata.com/kapacitor/v1.3/nodes/join_node/, You can compute the mean of each of the fields and then join them back together into a single point and send that point to the alert node.

1 Like

Thanks Nathaniel, sorry for delayed response. Makes sense, will give it a whirl.