产品动态
APPID + Token 的方式进行鉴权访问。Token 从对应 Prometheus 实例的基本信息中获取。GET /api/v1/queryPOST /api/v1/query
-query.timeout 参数指定。curl -u "appid:token" 'http://IP:PORT/api/v1/query?query=up'
< HTTP/1.1 401 Unauthorized< Content-Length: 0
GET /api/v1/query_rangePOST /api/v1/query_range
/api/v1/query_range 接口,示例如下:$ curl -u "appid:token" 'http://IP:PORT/api/v1/query_range?query=up&start=2015-07-01T20:10:30.781Z&end=2015-07-01T20:11:00.781Z&step=15s'{"status" : "success","data" : {"resultType" : "matrix","result" : [{"metric" : {"__name__" : "up","job" : "prometheus","instance" : "localhost:9090"},"values" : [[ 1435781430.781, "1" ],[ 1435781445.781, "1" ],[ 1435781460.781, "1" ]]},{"metric" : {"__name__" : "up","job" : "node","instance" : "localhost:9091"},"values" : [[ 1435781430.781, "0" ],[ 1435781445.781, "0" ],[ 1435781460.781, "1" ]]}]}}

文档反馈