arachnys / cabot

Self-hosted, easily-deployable monitoring and alerts service - like a lightweight PagerDuty
MIT License
5.59k stars 594 forks source link

Add units to checked values #597

Open jazzzz opened 6 years ago

jazzzz commented 6 years ago

For large values, Cabot status messages can be hard to read (like "16360927232.0 < 100000000000.0"). It would be nice to set a unit to the checked metrics and use it to humanize displayed values (like Grafana for example).

image

dbuxton commented 6 years ago

I guess an initial implementation of this could be as simple as defining an optional format string in Python syntax? So a value of 13252352.304 and format string of %.2e would result in 1.33e+07.

jazzzz commented 6 years ago

A format string would be better than nothing, but it's still harder to read "13252352" against "3 hours, 40 minutes, 52.352 seconds".

dbuxton commented 6 years ago

Point taken - what would be the most important types then in your opinion?

In terms of otherwise unreadable, I guess:

Other units seem like they are less of an issue to me.

jazzzz commented 6 years ago

This would cover most (if not all) my needs!

hartwork commented 6 years ago

You're considering to add support of user controlled format strings, right? I would like to point out potential security implications, e.g. when using .format: http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/.