Query monitor metrics
get_metricsAnswer trend questions like 'how has p90 duration changed this month' or 'how has queue_depth trended'. Returns time series for the requested built-in fields or one custom metric (each reported value on the same short windows job charts use for raw points, otherwise avg and count per bucket), per monitor per environment (or per region for checks), matching cronitor metric get. Use metric_names to list known custom metric names. Requires at least one of monitors, groups, tags, or types.
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": "get_metrics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Range end as unix seconds. Defaults to now. | |
| env | No | Environment key or name. Defaults to the organization's default environment. A human saying 'staging' usually means the environment named staging. | |
| tags | No | Tags; includes every monitor carrying any of them. | |
| time | No | Named time range ending now. Overrides start and end. | |
| start | No | Range start as unix seconds. Defaults to one hour before end. | |
| types | No | Monitor types to include. | |
| fields | No | Built-in metric fields to return for each period. | |
| groups | No | Group keys; includes every monitor in each group. | |
| metric | No | Custom metric name to query. Short windows return each reported value; longer windows return avg and count per bucket. Leading/trailing whitespace is trimmed and names are lowercased. Cannot be combined with fields or metric_names. | |
| regions | No | Check regions to include. Defaults to every region. | |
| monitors | No | Monitor keys to include. | |
| with_nulls | No | Emit explicit null periods where no data was recorded. | |
| metric_names | No | List known custom metric names for the selected monitors and range. |