If you request 6 months of data at 1-second resolution, you are asking Prometheus to scan billions of samples. The server may reject the query immediately with a 400 because it recognizes the resource cost is impossible.
debugging-prometheus-400-bad-request
Troubleshooting the Ghost: Decoding the “400 Bad Request” from the Prometheus API If you request 6 months of data at
Prometheus expects a Content-Type header for POST queries ( application/x-www-form-urlencoded ). If the proxy manipulates this, Prometheus throws a 400. Prometheus throws a 400.