Coloring thresholds for boolean with Singlestat graph

image

If I simply want a red background on a 0 value, and green on 1, what do I set the thresholds to?

I’m confused.

Hi,

I use the icinga states as value mapping:

1 Like

Zero is up? Hmmm, Wonder what is best practice because I was using the reverse!

Check Result State Mapping

https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#host-states

IMHO this one shows green/yellow only for 0/1 values:

1,2 will produce: 
value < 1             => Green
1 <= value < 2        => Yellow
value >= 2            => Red

Why not 0.5,0.6 with inverted color order for “boolean” 1-green/0-red values ?

0.5,0.6 will produce: 
value < 0.5             => Red
0.5 <= value < 0.6      => Yellow
value >= 0.6            => Green

Keep in mind that boolean values can be float. For example when you use AVG function.

1 Like

Thank you! Now I am hitting a valueMap bug: Singlestat: support empty value map texts · Issue #20886 · grafana/grafana · GitHub

I think it’s a bug.