在grafana中使用FLUX查询语言显示InfluxDB数据时出现“指标请求错误”

时间:2020-09-11 14:28:45

标签: grafana flux

我有一个influxDB(称为“ brunosdb”)并使用telegraf,目前有多个活动的输入插件,例如正在跟踪CPU使用率。我可以在grafana中显示。但是,我还有一个活动的MQTT数据入口,用于输入流入线路数据。

当我想在Grafana中绘制MQTT数据时,出现错误

statusText:"Internal Server Error"
data:Object
message:"Metric request error"
isHandled:true
message:"Metric request error"

这是我的查询

from(bucket: "brunosdb/autogen")
|> range(start: -100h)

如果我使用此查询:

from(bucket: "brunosdb/autogen")
|> range(start: -1h)
|> filter(fn: (r) =>
  r._measurement == "cpu")

显示的CPU使用率很好。

在InfluxDB本身中,数据的确看起来完全不同:

> select * from cpu
1599833060000000000 cpu-total Aedifion-Logger-0271 0           0                97.27822580655675 0.025201612903207323 0         0          0.025201612903207323 0           1.5372983870962196  1.1340725806449026
1599833060000000000 cpu0      Aedifion-Logger-0271 0           0                98.89669007020493 0.1003009027080927   0         0          0.10030090270816397  0           0.30090270812406433 0.6018054162481287
1599833060000000000 cpu1      Aedifion-Logger-0271 0           0                97.70000000003739 0                    0         0          0                    0           0.7000000000026557  1.600000000003147
1599833060000000000 cpu2      Aedifion-Logger-0271 0           0                94.56967213115655 0                    0         0          0                    0           4.200819672131911   1.2295081967208532
1599833060000000000 cpu3      Aedifion-Logger-0271 0           0                97.98792756541916 0                    0         0          0                    0           1.0060362173064326  1.006036217304145
1599833070000000000 cpu-total Aedifion-Logger-0271 0           0                97.5579053372872  0                    0         0          0.02517623363544183  0           1.6112789526682771  0.8056394763329937
1599833070000000000 cpu0      Aedifion-Logger-0271 0           0                97.98792756527865 0                    0         0          0                    0           1.3078470824938468  0.7042253521108397

> select * from flowrate
1599729636000000000 3.70275211334228
1599729650000000000 2.61370754241943
1599729665000000000 2.17808961868286
1599729681000000000 2.61370754241943
1599729697000000000 3.48494315147399
1599729711000000000 3.70275211334228
1599729725000000000 3.92056107521057
1599729741000000000 3.26713418960571
1599729755000000000 4.35617923736572
1599729771000000000 4.79179716110229


如何正确显示我的数据?

0 个答案:

没有答案