0
我有一个influxdb,并希望在grafana上显示下采样值。如何在grafana中显示降采样值?
InfluxDB版本:1.2
Grafana版本:4.2
我创建了一个influxedb数据库:
> CREATE DATABASE "mydb3_rp"
然后,我已经创建了一个保留策略:
> CREATE RETENTION POLICY "1week" ON "mydb3_rp" DURATION 1w REPLICATION 1
然后,我创建了连续查询:
create continuous query "cq_10" on mydb3_rp begin select mean(\*) into "mydb3_rp"."1week".:MEASUREMENT from /.\*/ group by time(10m),* end
然后我把一些数据到数据库中。当我完成,并希望看到保存的值与涌入的命令行工具:
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...
现在我想明白了,如果连续查询是工作,做了汇总:
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
现在我进入grafana并定义这样的查询:
FROM 1week cpu1 select field(value)
有AR e - 没有数据点
难道downvoter可以解释为什么这个答案没有用吗? 反向引用连续查询显然有效,在这种情况下,要检索mean_value,应使用完全合格的度量。在我看来这是正确的方法,并且在我的工作中效果很好。 – kmwil
我在保留策略之前忘记了数据库名称,已更正。 – kmwil