query_prometheus_range
Execute a PromQL range query over a time window: the tool for trends, usage over time, restarts in a period and spike detection. The platform metrics store answers first and needs no connected Prometheus: it holds the Ankra agent's ankra_* series (ankra_node_cpu_usage_cores, ankra_node_memory_working_set_bytes, ankra_namespace_pod_restarts, ankra_workload_pod_restarts and the rest named in query_prometheus). cAdvisor and kube-state-metrics names answer only from a Prometheus connected in Cluster Settings > Metrics. Results are automatically truncated to fit context limits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | Resolution step (e.g. '30s', '1m', '5m'). Auto-calculated from duration if omitted. | |
| query | Yes | PromQL query string (max 2000 chars). | |
| duration | No | Lookback duration from now (e.g. '15m', '1h', '6h', '24h', '7d'). Defaults to '1h'. | 1h |
| cluster_id | Yes | Ankra cluster id (UUID) the call targets. Discover ids with list_clusters. |