Requirements
promtool - see installation steps here
Command
promtool query instant '<PROM_SERVER_URL>' '<PROM_QUERY>' | jq
Normal output example
promtool query instant 'http://localhost:9090/' 'up' | jq
JSON output example
promtool query instant -o json 'http://localhost:9090/' 'up' | jq
References