prometheus
Query Prometheus servers to retrieve instant snapshots or time-series metrics, formatted for charting, with options to group by labels, specify units, and target specific clusters.
Instructions
Queries a Prometheus server (snapshot or range) and returns metrics formatted for charting.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
cluster | No | Target cluster name in a multi-cluster environment. Defaults to the hub cluster if not provided. | default |
data_type | No | Type of query: 'snapshot' (instant) or 'range' (time-series). | snapshot |
end | No | (range only) End time in ISO 8601 format. Defaults to current time if not provided. | |
group_by | No | Label to group results by, such as 'pod' or 'namespace'. If not specified, behavior depends on the query (e.g., 'sum', 'avg'). | pod |
ql | Yes | The PromQL query string to run against the Prometheus server. | |
start | No | (range only) Start time in ISO 8601 format, e.g., '2025-06-06T00:00:00Z'. | |
step | No | (range only) Resolution step (e.g., '30s', '5m', '1h'). Choose appropriately to keep the sample count under 200. | |
unit | No | Desired output unit. Use 'auto' to infer from the query content (e.g., memory → MiB, CPU → cores). | auto |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cluster": {
"default": "default",
"description": "Target cluster name in a multi-cluster environment. Defaults to the hub cluster if not provided.",
"type": "string"
},
"data_type": {
"default": "snapshot",
"description": "Type of query: 'snapshot' (instant) or 'range' (time-series).",
"enum": [
"snapshot",
"range"
],
"type": "string"
},
"end": {
"description": "(range only) End time in ISO 8601 format. Defaults to current time if not provided.",
"type": "string"
},
"group_by": {
"default": "pod",
"description": "Label to group results by, such as 'pod' or 'namespace'. If not specified, behavior depends on the query (e.g., 'sum', 'avg').",
"type": "string"
},
"ql": {
"description": "The PromQL query string to run against the Prometheus server.",
"type": "string"
},
"start": {
"description": "(range only) Start time in ISO 8601 format, e.g., '2025-06-06T00:00:00Z'.",
"type": "string"
},
"step": {
"description": "(range only) Resolution step (e.g., '30s', '5m', '1h'). Choose appropriately to keep the sample count under 200.",
"type": "string"
},
"unit": {
"default": "auto",
"description": "Desired output unit. Use 'auto' to infer from the query content (e.g., memory → MiB, CPU → cores).",
"enum": [
"auto",
"bytes",
"MiB",
"GiB",
"cores",
"millicores"
],
"type": "string"
}
},
"required": [
"ql"
],
"type": "object"
}