query_metrics
Query Dynatrace metrics for any chart and get per-series summaries—min, avg, max, last value, trend, and readable values over time. Scope by entity and time.
Instructions
Runs a Dynatrace metric query (the data behind any chart) and returns each series summarised: min, avg, max with its timestamp, last value, trend, and a compact table of values over time. Values are converted to readable units (µs → ms/s, bytes → MiB/GiB) from the unit of the metric descriptor; when Dynatrace names no unit, or the descriptor cannot be read, the values are printed raw and the output says so. The descriptor describes the plain metric, so after a transformation that changes the unit (:rate, :count, arithmetic) read the numbers with that in mind.
selector uses the Dynatrace metric selector language: a metric id plus optional transformations, e.g.
builtin:service.response.time:percentile(95)builtin:service.errors.total.rate:splitBy("dt.entity.service"):sort(value(avg,descending)):limit(10):namesbuiltin:containers.memory.residentSetBytes:splitBy("dt.entity.container_group_instance"):max:namesSeveral selectors can be given comma-separated. Append:namesso entity names are shown next to their ids. Find metric ids withfind_metrics.
Scope to entities with entity_selector (entitySelector syntax), e.g. entityId("SERVICE-1234567890ABCDEF") or type(HOST),entityName.contains("web"). resolution sets the point spacing (1m, 5m, 1h, 1d, or Inf for a single value over the window); by default Dynatrace picks one that fits the window.
This tool runs through the Dynatrace Bridge browser extension in the user's logged-in browser. If it fails, report the error to the user; do not try to open browser tabs or use browser automation instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time_to | No | Absolute end time, ISO 8601; without a zone it is read as UTC. Without time_from, the window starts minutes_lookback before this. Must not be in the future. | |
| selector | Yes | Metric selector: metric id with optional transformations (:avg, :max, :percentile(95), :splitBy("dimension"), :filter(...), :sort(...), :limit(n), :names, :rate(1m), …). | |
| time_from | No | Absolute start time, ISO 8601 (e.g. '2026-09-23T10:28:00Z'). A timestamp without a zone (Z or ±hh:mm) is read as UTC. Without time_to, the window runs from here to now. Must not be in the future. | |
| max_series | No | Maximum series summarised per metric, ranked by average. Default 10, at most 50. | |
| resolution | No | Point spacing: '1m', '5m', '1h', '1d', a point count like '60', or 'Inf' for one aggregated value. Default: chosen by Dynatrace for the window. | |
| environment | No | Which Dynatrace environment to query, as named in the Dynatrace Bridge extension popup. Omit it for the default, the first environment configured there. The names are not listed here because the extension had not connected yet when this description was built; `dynatrace_bridge_status` lists them. | |
| entity_selector | No | Optional entitySelector limiting the entities the metric is read for, e.g. `entityId("HOST-1234567890ABCDEF")`. | |
| minutes_lookback | No | Window length in minutes. Default 120. With neither time_from nor time_to it means the last N minutes up to now; with only time_to it means the N minutes ending at time_to; ignored when time_from is given. The response header always shows the resolved absolute UTC window. |