I have a service running that publishes regularly Metrics to NewRelic.
Now, I want to determine the “uptime” of my service by counting the 1 minutes window where the metric is published (on average) at least 20 times per second.
I can do that with a query like
FROM (FROM Metric SELECT clamp_min(1 - floor(abs(rate(sum(my_metric), 30 seconds) / (30 * 20) - 1) / 0.2), 0) AS is_up TIMESERIES 1 minutes ) SELECT sum(is_up) / 60 SINCE 1 hours ago
The problem is that as I try to enlarge the
SINCE clause, I get the error
TIMESERIES supports a maximum of 366 buckets. Query has 420.
One way to obtain that would be to persist the inner query as another metric of my system, and make a query on that.
Otherwise, I don’t know if there’s a better way to construct what I need…