Prometheus Metrics

Run multiple Prometheus queries in one request

Executes up to 20 PromQL queries (instant and/or range) concurrently against the default Prometheus instance and returns results keyed by query id. Replaces many separate /query and /query_range calls.

post/api/v1/prometheus/query_batch

Request

  • Base URL
    http://localhost:8080
  • Auth
    API key in header Authorization

Request body

endstring
startstring
stepstring

Example request

{
  "end": "1791295351",
  "queries": [
    {
      "id": "cpu",
      "query": "sum(rate(container_cpu_usage_seconds_total[5m]))",
      "type": "range"
    }
  ],
  "start": "1791208951",
  "step": "600"
}

Response

Results keyed by query id

object required

Changes

No recorded changes to this operation across all 1 revision of this API.