I'm trying to setup Bosun and Graphite to alert on error ratio, compiled from two different sources: API traffic and web app traffic. Here's what I have now:
$web_rate = avg(graphite("sumSeries(collectd.*.statsd.web.*.rate)", "5m", "", ""))
$api_rate = avg(graphite("sumSeries(collectd.*.statsd.api.*.rate)", "5m", "", ""))
$web_error_rate = avg(graphite("sumSeries(collectd.*.statsd.web.*.errorRate)", "5m", "", ""))
$api_error_rate = avg(graphite("sumSeries(collectd.*.statsd.api.*.errorRate)", "5m", "", ""))
$total_rate = ungroup($web_rate) + ungroup($api_rate)
$total_error_rate = ungroup($web_error_rate) + ungroup(api_error_rate)
$error_ratio = $total_error_rate / $total_rate
Our counters don't exist in graphite until they are non-zero, so for our pre-production environment, the above fails with the following:
ungroup: requires exactly one group
When I look in the expression browser, the graphite(...)
call is returning, as expected, an empty set but the result of avg(graphite(...))
displays nothing.
Does anyone know how to handle this?