How to show downsampled values in Grafana with influxdb?

I have a influxdb and want to show the downsampled values on grafana.

InfluxDB Version: 1.2

Grafana Version: 4.2

  • I have created a influxedb database:
    > CREATE DATABASE "mydb3_rp"

  • Then I have created an retention policy:
    > CREATE RETENTION POLICY "1week" ON "mydb3_rp" DURATION 1w REPLICATION 1

  • Then I have created the continuous query:
    > create continuous query "cq_10" on mydb3_rp begin select mean(\*) into "mydb3_rp"."1week".:MEASUREMENT from /.\*/ group by time(10m),* end

  • Then I put some data into the database. When I finished and want to see the saved values with the influx command line tool :

select * from cpu1 name: cpu1 time cluster node value
---- ------- ---- ----- 2017-05-03T17:06:00Z cluster-2 node2 2.9552020666133956 2017-05-03T17:07:00Z cluster-2 node2 -1.5774569414324822 2017-05-03T17:08:00Z cluster-2 node2 0.16813900484349714 2017-05-03T17:09:00Z cluster-2 node2 1.244544235070617 2017-05-03T17:10:00Z cluster-1 node2 7.833269096274834 2017-05-03T17:10:00Z cluster-2 node2 -5.440211108893697 2017-05-03T17:11:00Z cluster-1 node2 -6.877661591839738 and so on...

  • And now I want to see, if the continuous query was working and did the aggregation:

select * from "1week".cpu1 name: cpu1 time cluster mean_value node
---- ------- ---------- ---- 2017-05-03T16:45:00Z cluster-1 1.074452901375393 node1 2017-05-03T16:45:00Z cluster-2 1.477524301989568 node1 2017-05-03T16:45:00Z cluster-1 0.8845193960173319 node2 2017-05-03T16:45:00Z cluster-2 -0.6551129796659627 node2 2017-05-03T16:50:00Z cluster-2 -1.6457347223119738 node1 2017-05-03T16:50:00Z cluster-2 0.6789712320493559 node2 ...and so on

  • Now I go into grafana and define a query like this :

FROM 1week cpu1 select field(value)

There are - No Data Points

Hey, the mistake is in your Influx, the field is called “mean_value” in your week RP.

And verify your CQ it may select every RP.

CREATE CONTINUOUS QUERY cq_build_15m  ON icinga2 BEGIN SELECT mean("value") as value, min("value") as min, max("value") as max INTO icinga2."rp_15m".:MEASUREMENT FROM icinga2."rp_raw"./.*/ GROUP BY TIME(15m), hostname, metric, service END

Here is one of our CQs I hope it is a good hint for you. We worked about a week to get good CQs. It was a lot of work because it’s hard to find good examples.

1 Like

yes, its a good hint.
I deleted all my influx databases and started from scratch.

And now - it works - Grafana shows also the aggregated values. !

Thank You

Hi Skirsten i am getting the same issue. i can see the downsampled metrics in influxdb. But i am not able see the values in grafana. can you explain how you resolved the issue. It will be very helpful.