query_metrics
Query Dynatrace metrics over a time range and return per-series min, max, average, and last values; optionally include every datapoint for deeper analysis.
Instructions
Query metric data (GET /api/v2/metrics/query) with per-series min/max/avg/last. Needs metrics.read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to_time | No | End: now, ISO-8601 or epoch ms | now |
| from_time | No | Start: now-2h, ISO-8601 (2026-10-31T10:00:00Z) or epoch ms | now-2h |
| resolution | No | e.g. 1m, 5m, 1h, Inf; empty = automatic | |
| mz_selector | No | Management zone, e.g. mzName("Prod") | |
| entity_selector | No | Limit to these entities | |
| metric_selector | Yes | e.g. builtin:service.response.time:avg or builtin:host.cpu.usage:splitBy("dt.entity.host"):max | |
| include_datapoints | No | Return every timestamp/value, not only the summary |