Is there a way to have two different aggregates in a group by. Basically what I am looking to do is take the mean across a group by time statement and then sum up across the other tags. For an example.
Lets say I have a metric http.requests.count that has a tag of host. I want to take the mean across the group by time() statement and then sum up the count for the hosts per time interval as well.
Basically something like
select sum("time_avg") from (select mean(count) as "time_avg" where time > now() - 12h group by time(1m), host) group by time(1m)
I realize that I can prob do it with a CQ, but was hoping there was a more adhoc way
Yeah I get an error when I try to run the query as shown above
select sum("time_avg") from (select mean(count) as "time_avg" from "http.requests.count" where time > now() - 12h group by time(1m), host) group by time(1m)
ERR: error parsing query: aggregate functions with GROUP BY time require a WHERE time clause