Reputation: 1087
I wrote an exporter which exposes timestamp next to the metric like:
test_load_min{app="web01"} 1 1483228810000
test_load_min{app="db01"} 2 1483228820000
test_load_min{app="email01"} 3 1483228830000
According to https://prometheus.io/docs/instrumenting/exposition_formats/ this should be fine for Prometheus, but querying test_load_min in Prometheus UI returns empty result. Same without timestamps works fine. Anyone has an idea what's wrong there?
Upvotes: 7
Views: 33589
Reputation: 81
You need to convert into ms. Once you are able to do, timestamp can be parsed.
For example:
timestamp = int(float(datetime.datetime.now().timestamp()) * 1000)
Upvotes: 1
Reputation: 425
Timestamps are not designed for the uploading of historical data.
There's a plan to add support for bulk historical uploads, tracked here. The issue is still open for now though.
In the meantime, you could look at promqueen which claims to solve this problem (though not for influxdb).
Upvotes: 3
Reputation: 3579
The timestamp 1483228810000
converts back to January of this year.
Prometheus omits time series from query results if the timestamp for which the query is executed is more than 5 minutes away from the nearest sample.
It is also not advised to use timestamps in this way.
Upvotes: 5