Query Workload Metrics (PromQL)
query_metricsRun a PromQL query over Control Plane metrics. Default: a range query over the last hour at a 60s step; resolution "instant" for one point, and since, from, to, and step to adjust. Prose shows the first 50 series; the full response is attached as JSON. Gauges (cpu_used, mem_used, replica_count) and the pre-rated egress and requests_per_second are queried bare; counters need rate(), e.g. sum by (workload) (rate(container_restarts[5m])); latency is histogram_quantile(0.95, sum by (le) (request_duration_ms_bucket)). Without query, lists the metrics instead: the documented defaults with a PromQL template each, plus every metric present in the org now (custom, mk8s). mk8s clusters with the metrics add-on label their series cluster_name and node, e.g. sum by (node) (rate(node_cpu_seconds_total{cluster_name="prod",mode!="idle"}[5m])). List first when a name or label is uncertain or a query returns no series. Measure before changing autoscaling.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "query_metrics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of range — RFC3339 or epoch seconds. Default: now. | |
| org | No | Organization slug. | |
| from | No | Start of range — RFC3339 or epoch seconds. Overrides `since` when set. | |
| step | No | Step (range queries only). Examples: "15s", "60s", "5m". Default: "60s". | |
| limit | No | Without `query`: most documented metrics to list (default: all). | |
| query | No | PromQL, scoped to the org (no org label). Real metric names only; omit `query` to list them if unsure. Pre-rated egress, cross_zone_traffic, and requests_per_second are queried bare, never in rate(). | |
| since | No | Relative lookback (e.g., "5m", "1h", "24h"). Used when `from` is not provided. Default: "1h". | |
| filter | No | Without `query`: a case-insensitive substring that narrows the listed names, e.g. "cpu". | |
| metric | No | Without `query`: a metric name, custom ones too; returns its live labels and their values. | |
| resolution | No | `instant` for /query — a single sample at `to` (defaults to now); `from`/`since`/`step` are ignored. `range` for /query_range (default). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | The full result. Read this, not only the summary. | |
| details | No | ||
| summary | Yes | ||
| nextSteps | No |