我有一些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: peer重置连接“
你能帮我理解如何用查询设置te请求(如果我写错了curl请求)吗?谢谢大家!
发布于 2021-06-03 14:31:16
尝试URL编码查询参数。
curl 'http://localhost:9090/api/v1/query?query=sum%20by%20%28name%29%20%28container_memory_working_set_bytes%7Bnamespace%3D%22verification%22%2Cpod%3D~%22.%2B%22%2Ccontainer%21%3D%22POD%22%2Ccontainer%3D~%22.%2B%22%7D%29' | jqhttps://stackoverflow.com/questions/67823292
复制相似问题