美文网首页
Prometheus API查询

Prometheus API查询

作者: mmaoyu | 来源:发表于2017-08-24 15:43 被阅读0次

使用API接口查询监控信息比较常用的

/api/v1/query_range?query=xxx&start=xxx&end=xxx&step=xxx

query 比如 sum by(label1) (sum_over_time(serias{label1="xxx",label2="l2"}[1d]))

sum by 等同于mysql的group by

1d :start 为结束过去的一天的值

每查询一次,start值往后推step时间,如果此时start<=end ,再次查询,直到start>end,停止查询

相关文章

网友评论

      本文标题:Prometheus API查询

      本文链接:https://www.haomeiwen.com/subject/videdxtx.html