API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsGet data from Prometheus

Get data from Prometheus

GET /api/control_plane/prometheus/{prometheus_path}

GET /api/control_plane/prometheus/{prometheus_path}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

prometheus_path*|

Prometheus HTTP API endpoint. See the Prometheus docs for the available URL query parameters for each endpoint.

Response Body

application/json

curl -X GET "$API_BASE_URL/api/control_plane/prometheus/api/v1/query"

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/control_plane/prometheus/{prometheus_path}

Get data from Prometheus

Parameters

  • prometheus_path (path, string, required): Prometheus HTTP API endpoint. See the Prometheus docs for the available URL query parameters for each endpoint.

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/control_plane/prometheus/{prometheus_path}'