prometheus
Query Prometheus metrics for charting, supporting instant or time-series data. Group results by labels like 'pod' or 'namespace', and specify units such as bytes or cores. Works across multi-cluster Kubernetes environments.
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 |