The WP Cloud Metrics API now runs queries more efficiently, so dashboards and reports can get results sooner. The API also gives more specific responses when it can’t complete a query. These changes are live. If you use the API, check how your integration handles HTTP 429 and 400.
The changes apply to POST /metrics/site/{site} and POST /metrics/client/{client}, including their /summarize variants. They also apply to the deprecated POST /site-metrics/{site} endpoint.
How the API handles query failures
Some query failures that previously returned a generic HTTP 500 now tell you when to retry or how to adjust the request.
| When | Response | What to do |
|---|---|---|
| The metrics service is busy, or the query times out or is interrupted. | HTTP 429 with a Retry-After header. | Wait at least the number of seconds in Retry-After before retrying. |
| The query exceeds a memory, row, or byte limit. | HTTP 400 with a message asking you to narrow the request. | Shorten the time range or query fewer hosts before trying again. |
| The API can’t connect to the metrics data source, or another backend error occurs. | HTTP 500 is still possible. | Keep your existing server-error handling. |
Successful requests still return HTTP 200.
Check your integration
If your integration expects query failures to return 500, add handling for 429 and 400. Waiting before retrying a 429 gives the metrics service time to recover under load. If you use the deprecated site endpoint, check that saved filters and top results still match what your integration expects.
See the Metrics guide and API reference for request parameters and response details.
The November 30 API changelog entry summarizes the release.