I am trying to construct curl API query to get Json data from Prometheus. The working in Prometheus UI query looks like:
max_over_time(container_memory_usage_bytes{image!="",pod_name=~"somepod-.*"}[7d])
So I am trying with:
curl 'http://127.0.0.1:20001/api/v1/query?query=max_over_time(container_memory_usage_bytes{(pod_name="somepod-.*")})[1d]' | jq
But depending on brackets it always complaining about something like expected or unexpected character.
You want:
curl -g 'http://127.0.0.1:20001/api/v1/query?query=max_over_time(container_memory_usage_bytes{pod_name=~"somepod-.*"}[1d])' | jq
This disables curl's globbing, which gets in the way here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With