Query Prometheus range
query_prometheus_rangeExecute 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"cluster_id": "<cluster_id>"
},
"name": "query_prometheus_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | Resolution step: a duration (e.g. '30s', '5m', '1h30m') or a whole number of seconds (e.g. '300'). Auto-calculated from duration if omitted. | |
| query | Yes | PromQL query string (max 2000 chars). | |
| duration | No | Lookback duration from now: a duration with units largest first (e.g. '15m', '1h', '3h20m', '7d') or a whole number of seconds (e.g. '3600'). Defaults to '1h'. | 1h |
| cluster_id | Yes | Ankra cluster id (UUID) the call targets. Discover ids with list_clusters. |