Alert Manager memory alert format issue

14 views
Skip to first unread message

Ankit Shah

unread,
May 15, 2020, 5:07:25 AM5/15/20
to Prometheus Users
Hi,

We have configured alert manager if memory usage per container goes above 8 GB. 

we are getting alert but usage value is coming in "7.073439744e+09" this format. is there anyway we can convert this to more user friendly format like "8.x GB",

we tried going through code but didnt find an option.

Julius Volz

unread,
May 16, 2020, 5:59:23 PM5/16/20
to Ankit Shah, Prometheus Users
Yes, you can use one of these templating functions in your alerting rule annotations: https://prometheus.io/docs/prometheus/latest/configuration/template_reference/#numbers

For example, something like this:

alert: MyMemoryHighAlert
expr: container_memory_usage_bytes > 8 * 1024^3
annotations:
  summary: "Container {{$labels.name}} on {{$labels.instance}} is using {{$value | humanize1024}} GiB of memory."

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/d4a3dc48-3ac8-4074-a1bb-f568ea22e650%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages