我写了一个导出器,它在指标旁边公开时间戳,例如:
test_load_min{app="web01"} 1 1483228810000
test_load_min{app="db01"} 2 1483228820000
test_load_min{app="email01"} 3 1483228830000
根据 https://prometheus.io/docs/instrumenting/exposition_formats/这对于 Prometheus 应该没问题,但是在 Prometheus UI 中查询 test_load_min 返回空结果。同样没有时间戳也能正常工作。有人知道那里有什么问题吗?
最佳答案
时间戳 1483228810000
转换回今年一月。
如果执行查询的时间戳与最近的样本相距 5 分钟以上,则 Prometheus 会从查询结果中省略时间序列。
也不建议以这种方式使用时间戳。
关于timestamp - 普罗米修斯时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43890629/