query_otlp_metrics
Run PromQL queries against native OTLP metrics to fetch current values or time-series samples for monitoring and troubleshooting.
Instructions
Run a PromQL query against native OTLP metrics. A range query (start and end in epoch seconds, optional step) returns each series' samples over the window; instant=true returns each series' value now and takes no window. Returns at most 20 series and 500 points a series, downsampled; for statistics on a series use analyze_metric(source="otlp")
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>"
},
"name": "query_otlp_metrics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end, unix epoch seconds; range queries only | |
| step | No | Resolution step, e.g. '30s', '5m', '1h'; range queries only; use larger steps for wider windows | |
| query | Yes | PromQL expression. Examples: container_memory_usage_bytes (raw series), avg(container_cpu_usage_seconds_total) (aggregate), rate(container_network_receive_bytes_total[5m]) (per-second rate), nginx_up{service_name="api"} (label matcher). Discover names and labels with get_otlp_metric_names / get_otlp_metric_labels | |
| start | No | Window start, unix epoch seconds; range queries only. Keep windows under ~30 days; very wide windows fail in the metrics backend | |
| instant | No | Read each series' value now instead of a range |