Ngalert labels and regex to reduce, round

I use Grafana v8.1.1 (90c87a52f7)
with enabled ngalert I was able to create a query to calculate percentage of memory use and to generate an alert based on this.

But I want to show the available memory in the Message. Currently my summary contains just the general alert and the description the full text.

Available memory {{ $values.B.Value }} GB is below 10% of total memory for instance {{ $labels.instance }}

this leads to a instance name with port (node:9100) which is somehow stupid
and a available memory with a lot of decimals…

So I want to add somthing to the end of the Variable {{ $labels.instance }} to remove the port number via regex and to round the value …
Or even another way would be nice

This topic was automatically closed after 365 days. New replies are no longer allowed.