Setting threshold from maximum to minimum

Hello,

Is it possible to set thresholds from Maximum to Minimum under singlestat panel.

I am collecting health score % metrics(ex: 85%…), and expect color change if metrics goes down below 30% till 0%.

Hope i make sense. :slight_smile:

Regards,
Rohit

This sounds simple unless I am misunderstanding :slight_smile:

Just invert the threshold colors and set the threshold to 30. So a value is green if it is over 30 but would be red if it went under 30:

Thanks for the help…Daniellee :slight_smile:

1 Like

How about if we want to show a threshold of a value Being either positive or negative ?

ie -300 … 0 is a red part in the gauge
0 … 300 is a green part in the guage

That should work. Singlestat can handle negative values in thresholds.

So how would you input that in the threshold area?

-300,300
or
some combination of -300,0,300

So basically if it is less than 0 it should be red and if it is greater than 0 it should be green. Thresholds are usually defined with two values giving you three states (red, yellow, green). In your case, you only want two states so this should work:

image

Great thank you.

So in the context of a Boolean
My DB reads 1 (True) or 0 (False)

Would I set up my threshold the same way = 0,1 (invert)

When comparing a range, the logic is > lower threshold and <= higher threshold so in your case, you could use a decimal to get >= for the lower threshold.

Like this: 0.1,1 (invert)

Hi daniellee ! Can we implement a threshold based on another column value ?


To be more clear, I want the color to turn red if it value is lower than the other value on the right.
Thanks

@daniellee This invert toggle seems to be gone with Grafana7.3. Or am I not seeing it?

1 Like

I dont see it either, I also dont see it on 7.5.7 and 8.0.0-beta3. Does anybody know how to invert the treshholds there?

If you want it to be red if zero then you set a value of 0 with red and a value of some number to green. It’ll work. It’s not quite intuitive at first but it works.

2 Likes

Thanks @datadude! But, for example, I define 0 as red and 10 as yellow.
All the values between 0 and 10 will be red and all values above 10 yellow, right?

What if I want the values above 10 to be white and the values between 0 and 10 yellow?

Thank you :slight_smile:

I think you want to select Gradient Gauge for cell display mode in the override property section