22 Sep 2023 05:45 PM - last edited on 25 Sep 2023 12:11 PM by AgataWlodarczyk
I want to create a summary table that has 2 columns - the first column would be the name of the data, and the second would be the value. These values would be the min / max / average of various metrics over a given time period.
Or, if this can't be done, maybe 4 columns
- the first column to be the name of the metric,
- the second to be min,
- the third average,
- fourth max.
Whenever I try to do this I get a separate column for each calculation, which leads to a table with a lot of blanks in it. Any way to do this?
22 Sep 2023 08:15 PM
Hi @kostellod,
Can you share the wrong result table? and the mentioned calculations?
Best regards,
Mizső
22 Sep 2023 08:25 PM
This would be an example. I want 1 line, left column as "CPU %", 2nd as "Min", 3rd as "Avg", 4th as "Max". I'd like this for a couple of different metrics in the same table.
22 Sep 2023 08:33 PM - edited 22 Sep 2023 08:51 PM
Since you are using the same metric, you should include all the tags in the filter for the same query.
Example:
builtin:host.cpu.usage:filter(and(or(in("dt.entity.host",entitySelector("type(host),tag(~"YOUR_FIRST_TAG:HERE~")")),in("dt.entity.host",entitySelector("type(host),tag(~"YOUR_SECOND_TAG:HERE~")")),in("dt.entity.host",entitySelector("type(host),tag(~"YOUR_TIRDH_TAG:HERE~")"))))):splitBy("dt.entity.host"):sort(value(auto,descending)):limit(100)
EDIT:
In your case, you should create the following queries, using the same formula, just replacing the aggregation you need.
EDIT 2:
I see the problem now. With no 'split by' condition, you still get the one line per query... So I think this can be an Idea candidate...