API7 Docs

Get provider portal monitoring data over a range of time

GET /api/portal/monitor/query_range

GET /api/portal/monitor/query_range

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Query Parameters

query*string

Prometheus expression query string.

start*|

Start timestamp, inclusive. Accepts either a Unix timestamp or an RFC3339 timestamp.

end*|

End timestamp, inclusive. Accepts either a Unix timestamp or an RFC3339 timestamp.

step*|

Query resolution step width, either as:

  • a float number in seconds (e.g. 15.5), or
  • a duration string (e.g. 15s, 1m, 2h) in Prometheus-style duration format.
timeout?|

Evaluation timeout, either as:

  • A float number in seconds (e.g. 2.5)
  • A duration string (e.g. 5s, 1.5m) in Prometheus-style format.
limit?integer

Maximum number of returned series. 0 means disabled.

portal_id?string

The unique identifier of the portal instance.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256
Default"default"

Response Body

application/json

curl -X GET "$API_BASE_URL/api/portal/monitor/query_range?query=apisix&start=1718531400&end=1718531400&step=15.5"

The Prometheus proxy response.

{
  "value": {
    "status": "success",
    "data": {
      "resultType": "matrix",
      "result": [
        {
          "metric": {
            "label": "xxx"
          },
          "values": [
            [
              1684740675,
              1
            ],
            [
              1684740690,
              2
            ]
          ]
        }
      ]
    }
  }
}
Complete operation details and schema variants

GET /api/portal/monitor/query_range

Get provider portal monitoring data over a range of time

See Prometheus range queries for more information.

Parameters

  • query (query, string, required): Prometheus expression query string.

  • start (query, object, required): Start timestamp, inclusive. Accepts either a Unix timestamp or an RFC3339 timestamp.

  • end (query, object, required): End timestamp, inclusive. Accepts either a Unix timestamp or an RFC3339 timestamp.

  • step (query, object, required): Query resolution step width, either as:

  • a float number in seconds (e.g. 15.5), or

  • a duration string (e.g. 15s, 1m, 2h) in Prometheus-style duration format.

  • timeout (query, object, optional): Evaluation timeout, either as:

  • A float number in seconds (e.g. 2.5)

  • A duration string (e.g. 5s, 1.5m) in Prometheus-style format.

  • limit (query, integer, optional): Maximum number of returned series. 0 means disabled.

  • portal_id (query, string, optional): The unique identifier of the portal instance.

Responses

  • 200: The Prometheus proxy response.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional): The Prometheus raw data.
  • 400: Invalid arguments. Error details will be provided in the response.

cURL

curl -X GET '$API_BASE_URL/api/portal/monitor/query_range'