【发布时间】:2021-06-03 14:24:58
【问题描述】:
我有一些 PromQL 查询,我想使用 Prometheus 提供的 API 通过 HTTP 请求执行。
例如,有这样的查询:
sum by (name) (container_memory_working_set_bytes{namespace="verification",pod=~".+",container!="POD",container=~".+"})
如何输入 HTTP 请求?
我试过这样写:
curl -g 'http://localhost:9090/api/v1/query?sum by (name) (container_memory_working_set_bytes{namespace="verification",pod=~".+",container!="POD",container=~".+"})' | jq
但我收到“curl: (56) Recv failure: Connection reset by peer”
能否帮助我了解如何使用查询设置请求(如果我在编写 curl 请求时出错了)? 谢谢大家!
【问题讨论】:
标签: docker curl kubernetes scripting prometheus