GET
/v2/insights/query/{region}/prom/api/v1/query_rangeExecute a range PromQL query
To evaluate a PromQL expression over a time range, send a GET request to /v2/insights/query/{region}/prom/api/v1/query_range.
regionstringrequired
The datacenter region slug for the query.
querystringrequired
A PromQL expression. This may be a metric selector (for example `do.droplets.cpu_time`) or a fuller expression (for example `rate(do.droplets.cpu_time[5m])`).
startstringrequired
Start timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
endstringrequired
End timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
stepstringrequired
Query resolution step width as a Prometheus duration string (for example `15s`, `1m`, `1h`).
timeoutstringoptional
Optional evaluation timeout as a Prometheus duration string.
200Range query result.
statusstringrequired
dataobjectrequired
400Prometheus-style query error.
statusstringrequired
errorTypestringrequired
Prometheus error category.
errorstringrequired
Human-readable error message.
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403The authenticated principal does not have permission to perform this action on the requested resource.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404The resource was not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422Prometheus-style query error.
statusstringrequired
errorTypestringrequired
Prometheus error category.
errorstringrequired
Human-readable error message.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Prometheus-style query error.
statusstringrequired
errorTypestringrequired
Prometheus error category.
errorstringrequired
Human-readable error message.
503Prometheus-style query error.
statusstringrequired
errorTypestringrequired
Prometheus error category.
errorstringrequired
Human-readable error message.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Error handling
A 400 is returned: Prometheus-style query error. A 401 is returned: Authentication failed due to invalid credentials. A 403 is returned: The authenticated principal does not have permission to perform this action on the requested resource. A 404 is returned: The resource was not found. A 422 is returned: Prometheus-style query error. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: Prometheus-style query error. A 503 is returned: Prometheus-style query error. Any other status is an error: There was an unexpected error.