Thanos · Schema

Thanos Query Response

The standard JSON response envelope returned by Thanos Query API endpoints for instant and range queries. Compatible with the Prometheus API response format, with Thanos-specific additions such as partial response warnings.

MetricsMonitoringObservabilityPrometheusTime Series Database

Properties

Name Type Description
status string Indicates whether the query was successful or encountered an error.
data object The query result payload. Present when status is success.
errorType string Category of error. Present when status is error.
error string Human-readable error message. Present when status is error.
warnings array Warnings generated during query execution. In Thanos, this often includes partial response warnings when a store is unavailable.
View JSON Schema on GitHub

JSON Schema

query-response.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thanos.io/schemas/query-response.json",
  "title": "Thanos Query Response",
  "description": "The standard JSON response envelope returned by Thanos Query API endpoints for instant and range queries. Compatible with the Prometheus API response format, with Thanos-specific additions such as partial response warnings.",
  "type": "object",
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "type": "string",
      "description": "Indicates whether the query was successful or encountered an error.",
      "enum": [
        "success",
        "error"
      ]
    },
    "data": {
      "type": "object",
      "description": "The query result payload. Present when status is success.",
      "required": [
        "resultType",
        "result"
      ],
      "properties": {
        "resultType": {
          "type": "string",
          "description": "The type of result returned by the query.",
          "enum": [
            "matrix",
            "vector",
            "scalar",
            "string"
          ]
        },
        "result": {
          "description": "The query result data. Structure depends on resultType.",
          "oneOf": [
            {
              "title": "VectorResult",
              "description": "Result for instant vector queries.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "metric": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Label set identifying the time series."
                  },
                  "value": {
                    "type": "array",
                    "description": "A [unix_timestamp, sample_value] pair.",
                    "prefixItems": [
                      {
                        "type": "number",
                        "description": "Unix timestamp with millisecond precision."
                      },
                      {
                        "type": "string",
                        "description": "Sample value as a string to preserve precision."
                      }
                    ],
                    "minItems": 2,
                    "maxItems": 2
                  }
                },
                "required": [
                  "metric",
                  "value"
                ]
              }
            },
            {
              "title": "MatrixResult",
              "description": "Result for range vector queries.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "metric": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Label set identifying the time series."
                  },
                  "values": {
                    "type": "array",
                    "description": "Array of [unix_timestamp, sample_value] pairs.",
                    "items": {
                      "type": "array",
                      "prefixItems": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "minItems": 2,
                      "maxItems": 2
                    }
                  }
                },
                "required": [
                  "metric",
                  "values"
                ]
              }
            },
            {
              "title": "ScalarResult",
              "description": "Result for scalar queries.",
              "type": "array",
              "prefixItems": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ],
              "minItems": 2,
              "maxItems": 2
            },
            {
              "title": "StringResult",
              "description": "Result for string queries.",
              "type": "array",
              "prefixItems": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ],
              "minItems": 2,
              "maxItems": 2
            }
          ]
        }
      }
    },
    "errorType": {
      "type": "string",
      "description": "Category of error. Present when status is error."
    },
    "error": {
      "type": "string",
      "description": "Human-readable error message. Present when status is error."
    },
    "warnings": {
      "type": "array",
      "description": "Warnings generated during query execution. In Thanos, this often includes partial response warnings when a store is unavailable.",
      "items": {
        "type": "string"
      }
    }
  },
  "examples": [
    {
      "status": "success",
      "data": {
        "resultType": "vector",
        "result": [
          {
            "metric": {
              "__name__": "up",
              "instance": "prometheus-0:9090",
              "job": "prometheus"
            },
            "value": [
              1704067200,
              "1"
            ]
          }
        ]
      },
      "warnings": []
    },
    {
      "status": "success",
      "data": {
        "resultType": "matrix",
        "result": [
          {
            "metric": {
              "__name__": "http_requests_total",
              "method": "GET"
            },
            "values": [
              [1704060000, "100"],
              [1704063600, "150"],
              [1704067200, "200"]
            ]
          }
        ]
      },
      "warnings": [
        "store sidecar-prometheus-1:10901 is unhealthy, returning partial response"
      ]
    }
  ]
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/query-response"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.