Continuous queries and grafana visualization

Hey everyone!

We try to create retention policies on our data so we can reduce amount of data we store. The point is to have a graph divided into tree parts where every part would have different CQ and RP as well I think.

So graph in Grafana would show 3rd part where is older data in 5mins intervals, 2nd part in 3mins intervals and last 1st part would be shown in real time.

I have three retention policies for each part one and three CQs for each of them, however, it doesn’t do the job :frowning:

autogen  168h0m0s 168h0m0s           1        true
rp.1part 1h0m0s   1h0m0s             1        false
rp.2part 2h0m0s   1h0m0s             1        false
rp.3part 3h0m0s   1h0m0s             1        false


> create continuous query "cq_part1" ON grafanatest1 BEGIN SELECT mean(*) INTO "rp.1part"."downsampled_1part" FROM "cpu_load_short" GROUP BY time(2m) END
> create continuous query "cq_part2" ON grafanatest1 BEGIN SELECT mean(*) INTO "rp.2part"."downsampled_2part" FROM "cpu_load_short" GROUP BY time(4m) END
> create continuous query "cq_part3" ON grafanatest1 BEGIN SELECT mean(*) INTO "rp.3part"."downsampled_3part" FROM "cpu_load_short" GROUP BY time(6m) END

Any advise would be appreciated!!

Thanks in advance for any help!

What is “it” in this context? Which part of this workflow is not working?

Do your queries return any data if you run them manually?

SELECT mean(*) INTO “rp.1part”.“downsampled_1part” FROM “cpu_load_short” GROUP BY time(2m)

Thanks for your reply!

I think the problem I’m trying to solve is better explained here.

I want to see in Grafana aggregated older data and raw data in the same graph…

i’m far from an expert. but your problem does seem strange. will check it more detailed later. if you find the solution update.