Query Prometheus
query_prometheusExecute a PromQL instant query for the cluster. Returns current values as a vector. The platform metrics store answers first and needs no connected Prometheus: it holds the Ankra agent's ankra_* series (labels node; namespace; namespace, workload, kind), e.g. sum by (node) (ankra_node_cpu_usage_cores), sum by (node) (ankra_node_memory_working_set_bytes), ankra_node_cpu_capacity_cores, ankra_node_ready, sum by (namespace) (ankra_namespace_pod_restarts), ankra_namespace_pod_restarts_total, ankra_workload_pod_restarts, ankra_namespace_cpu_usage_cores, ankra_namespace_memory_working_set_bytes. cAdvisor and kube-state-metrics names (container_*, kube_*) answer only from a Prometheus connected in Cluster Settings > Metrics. For a trend or anything over a window use query_prometheus_range.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | PromQL query string (max 2000 chars). | |
| cluster_id | Yes | Ankra cluster id (UUID) the call targets. Discover ids with list_clusters. |