SingleStat red on value without read


I’m using grafana 4.6.3 over graphite over icinga2 and have a problem with displaying singlestat for null value.
I’m monitoring the time it takes to connect to our MongoDB using an icinga plugin. When I shut down the MongoDB daemon, Icinga starts alerting as expected. The plugin doesn’t return a value because there is no numerical value for no connection time, it’s just null.
When I’m trying to show this info in Grafana, I have a problem presenting it coloured red in the SingleStat pane (I don’t really care about the time it takes to connect, only if it’s successful), because null value isn’t something the numerical threshold can take as an input.
How can I display the information about the icinga service’s status? Using non-graphite database is possible although not a solution I’d like to take.



Please refer to the following issue. As you see in comments you may be successful by mapping null -> 0. Please give it a try.


Unfortunately, 0 represents 0 seconds to connect to the Mongo DB, and null means the connection has failed, so mapping null to 0 isn’t working in this case. Isn’t there any way I can use the background for non-numeric values, such as null?

Map null to 5000 or something then. I’m guessing that you have other values resulting in red? You cannot set background based on a null value - that’s not supported.


Thanks, that I did when I saw the mapping option, but still there has to be an option in a pane called singlestat to treat non-numeric values, there are a lot of checks that are either good or bad, without a numeric value, so the mapping does the trick, but it’s not satisfying the need of displaying check results of discrete values.

Understand. The singlestat panel is a bit limited today and only works with numeric values. You can upvote the issue I linked by giving it a thumbs up emoji if you’re interested in this feature.

There’s an open issue regarding a new multi stat panel that maybe will have much richer support for both numeric and string values. You can upvote that issue too if you’re interested in this feature.


1 Like