DataDog/dd-agent — pull request #834 by igor47 (2014-02-20 20:26:28+00:00)
Title: haproxy: count available/unavailable backends

currently, the haproxy check reports a count for each distinct status; this
means that service backends in status 'up' will end up in different buckets
then backends in status `up_1/3` and `up_2/3` (which result from backends going
through the haproxy health check rise/fall intervals). if you have a large
rise/fall count, there might be a huge number of separate buckets.

however, often, the real concern is "how many backends can and cannot recieve
new traffic". this question is what this PR is trying to answer. we group all
backends that have `up` in their state into the `available` category, and all
of the ones that are either `down`, in `maint`, or are set to `nolb` in the
`unavailable` category. we ignore `open` and `closed` becuase those pertain to
frontends, not backends.

all `available` backends can recieve traffic, while all `unavailable` ones
cannot. this provides a great metric to monitor and alert on.