Alertmanager: Format Value become scientific

Created on 16 Jun 2017  路  2Comments  路  Source: prometheus/alertmanager

I got some question regarding {{ $values }} usage,

I have basic alert which sending it to our slack:
this is the working one : Redis Server keys has increased 77.45077806845111%.

while, this is the issue : Production Server insert_shop_response Channel Depth is over (Current : 8.838815e+06).

_note : i removed my instance labels_

the problem is 8.838815e+06 value.

this is snippet of my config in alerts.rules

summary = "Production Server {{ $labels.instance }} {{ $labels.topic }} Channel Depth is over (Current : {{ $value }}).",

anyway to fix the value format ?

Most helpful comment

{{ $value | printf "%.2f" }} will round to two decimal places or {{ humanize $value }}.

All 2 comments

Usage questions are best asked at https://groups.google.com/forum/#!forum/prometheus-users

{{ $value | printf "%.2f" }} will round to two decimal places or {{ humanize $value }}.

Was this page helpful?
0 / 5 - 0 ratings