hello,

made it with "{{ humanize $value }}" in rules.yml.

thank you.
在2021年1月31日星期日 UTC+8 下午5:09:30<[email protected]> 写道:

> See also: 
> https://prometheus.io/docs/prometheus/latest/configuration/template_reference/#numbers
>
> On Sun, Jan 31, 2021 at 10:07 AM Julius Volz <[email protected]> 
> wrote:
>
>> In your annotation template, instead of "{{ $value }}", you can use "{{ 
>> $value | printf "%.2f" }}" to cut the value off after 2 decimal places. Or 
>> you could try "{{ humanize $value }}".
>>
>> On Sun, Jan 31, 2021 at 9:12 AM Auggie Yang <[email protected]> 
>> wrote:
>>
>>> guys,
>>>
>>> Configuration rules.yml with promethues, and alermanger always got some  
>>> long vlaue;
>>>
>>> just like memory usage: 70.25266596686059, disk usage: 65*.*58277282;
>>>
>>> is there has some good solutions to format prometheus's value with 70.xx 
>>> or 65.xx, not 70.xxxxxxxx, thanks.
>>>
>>> -- 
>>> 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 [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/prometheus-users/5c1766cc-6870-4a41-9480-15a905427dd6n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/prometheus-users/5c1766cc-6870-4a41-9480-15a905427dd6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Julius Volz
>> PromLabs - promlabs.com
>>
>
>
> -- 
> Julius Volz
> PromLabs - promlabs.com
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/b9508cb3-d428-4d07-adcf-1081e8317b9en%40googlegroups.com.

Reply via email to