GET/v2/insights/query/{region}/prom/api/v1/query

Execute an instant PromQL query

To evaluate a PromQL expression at a single point in time, send a GET request to /v2/insights/query/{region}/prom/api/v1/query.

4 parameters
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])`).
timestringoptional
Evaluation timestamp for an instant query. Accepts a RFC3339 string or a UNIX timestamp. Defaults to now when omitted.
timeoutstringoptional
Optional evaluation timeout as a Prometheus duration string.

10 status codes
200Instant query result.
statusstringrequired
Allowed:success
dataobjectrequired
400Prometheus-style query error.
statusstringrequired
Allowed:error
errorTypestringrequired
Prometheus error category.
Allowed:bad_datainternaltimeoutcanceledexecutionunavailable
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
Allowed:error
errorTypestringrequired
Prometheus error category.
Allowed:bad_datainternaltimeoutcanceledexecutionunavailable
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
Allowed:error
errorTypestringrequired
Prometheus error category.
Allowed:bad_datainternaltimeoutcanceledexecutionunavailable
errorstringrequired
Human-readable error message.
503Prometheus-style query error.
statusstringrequired
Allowed:error
errorTypestringrequired
Prometheus error category.
Allowed:bad_datainternaltimeoutcanceledexecutionunavailable
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.