You're probably looking at it the wrong way, and I expect you should 
configure Grafana to visualise correctly the response you have.

You can display or not display something in Grafana based on 
presence/absence of any value.  However usually it's more useful to *see* the 
actual failing value, because an indication of just "not healthy" doesn't 
give you any clue to help debug the problem.  One thing you can do in 
Grafana is to set thresholds and colours: e.g. display green if the value 
is between 0 and 5, amber if 5 to 10, red if 10 or higher.  That's often 
much more useful (except for users with colour blindness who may need 
additional cues).

However, you *can* also frig the queries in PromQL if required.  Since you 
don't give the actual queries, I can only talk in general terms.

foo < 1
# gives you some value for foo, if it's less than 1, and no value if foo >= 
1.

(foo < 1) * 0
# will always gives you a value of 0 if foo < 1, or no value if foo >= 1

foo < bool 1
# will always give you a value: 0 if foo < 1, 1 if foo >= 1

> For example, I might have a cluster where one of the servers can fail and 
still display an available service (and a result of 1 for my query), but 
having 2 failed servers would get me a result of "0" for my query.

I would be inclined make a query to count "number of failed servers", and 
set a display threshold on this.  Then the dashboard won't say "too many 
failed servers!", it will say "2 failed servers!"

-- 
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/15413390-51ff-46f4-8bf5-fc0dbfa67c77n%40googlegroups.com.

Reply via email to