Hi,
I am trying to group metrics based on field values. Lets assume the following:
I have a table like
CREATE TABLE test VALUES(time bigint, cpu_usage double precision, core_id int)
->
(1, 10, 0) // first time collect, core 0
(1, 15, 1) // first time collect, core 1
(2, 30, 0) // second time collect, core 0
(2, 5, 1) // second time collect, core 1
Now I want to have a graph panel where the cpu_usage field is shown for each core (core_id).
I tried:
SELECT time AS "time", avg(cpu_usage) AS "cpu_usage", core_id AS "core_id"
FROM test GROUP BY 1,3 ORDER BY 1
but this way I get two graphs, one for cpu_usage and the other one for core_id.
I remember that I did this some time ago, but I was using influxdb.
Thanks.