A 400 status code implies that the server could not understand the request due to invalid syntax. In the context of the Prometheus API, this usually translates to one of three things:
Check your reverse proxy config. Ensure it does not strip Host or Content-Length headers.
The most frequent trigger is simply invalid . You might have a missing brace, a wrong function name, or a logical error in your expression. A 400 status code implies that the server
If you paste the PromQL or the API call you were trying to run, I can help you: Spot the syntax error Fix illegal characters Check your time formatting
When querying the range API ( /api/v1/query_range ), you must provide start , end , and step . A 400 error often occurs if: The most frequent trigger is simply invalid
Check your up metric. If you see weird label values, you have found your problem.
/api/v1/query_range?query=up&start=1700000000&end=1699999999&step=1m (start after end) A 400 error often occurs if: Check your up metric
This error is a classic HTTP status code combined with a specific backend rejection from Prometheus itself. Unlike a generic 404 (Not Found) or 500 (Internal Server Error), a 400 Bad Request specifically means: "Your request was malformed, syntactically incorrect, or violated a constraint. The server refused to process it."