对针对InfluxDB

时间:2016-08-31 00:51:18

标签: influxdb grafana

我有InfluxDB 0.13,我通过HTTP API发送数据。我收回状态代码204,假设这意味着好的。如果我用" SHOW SERIES"查询,我可以看到该系列,我看到了测量和标签。但我无法查询任何数据,它只是说没有结果(查询:SELECT * FROM" sql-query")。 这是从Fiddler发送给Influx的原始数据。知道什么是错的吗?

sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXOff",LagMinutes=141278i 1472628420980000000
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXTIMEDEPOT",LagMinutes=248i 1472628420980000000
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXOffMirror",LagMinutes=0i 1472628420980000000
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXOffMirrorQA",LagMinutes=527i 1472628420980000000
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXOff",LagMinutes=141279i 1472628480390000128
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXTIMEDEPOT",LagMinutes=249i 1472628480390000128
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXOffMirror",LagMinutes=0i 1472628480390000128
sql-query,Environment=QA,Service=XTAM_Lag SubscriberName="TXXOffMirrorQA",LagMinutes=528i 1472628480390000128

1 个答案:

答案 0 :(得分:2)

By default, all InfluxDB queries with no time constraint will use the current time in UTC on the InfluxDB server as an implicit upper time bound. Essentially, the query SELECT * FROM "sql-query" is interpreted as SELECT * FROM "sql-query" WHERE time < now().

The current UTC time on the server running InfluxDB can be different from the current time on the server generating metrics. This difference can be due to either a bad clock or, more likely, the use of a time zone other than UTC.

If there is an offset, new data will sometimes be written with timestamps in the relative future. Due to the implicit upper time bound on queries explained above, those points will then be excluded from a basic query.

To confirm whether this is the issue, try running a query with the upper time bound set a few days in the future.

SELECT * FROM "sql-query" WHERE time < now() + 1w

The query above will return all points in the sql-query measurement, plus any points written written with a relative time up to a week in the future.