dynatrace_managed_query_metrics_data
Query metric data for a specific time range and metric selector, using an entity selector and matching resolution to limit results. Use it to retrieve targeted Dynatrace Managed performance metrics.
Instructions
Query metric data for a specific time range and metric selector. Must limit the amount of data being retrieved: must use a specific entitySelector, such as using specific entityIds; must use a narrow timerange (with from and to); must use a resolution in line with the timerange, for example if getting data covering several days then the resolution should be hours rather than minutes.
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": {
"metricSelector": "<metricSelector>",
"from": "<from>",
"to": "<to>",
"environment_alias": "<environment_alias>"
},
"name": "dynatrace_managed_query_metrics_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | End time (ISO format or relative like "now") | |
| from | Yes | Start time (ISO format or relative like "now-1h") | |
| resolution | No | Data resolution. Use a bigger resolution when the timerange is larger. For example, use "5m" for detailed analysis of data over hour(s), use "1h" for trends of data over a day, use 6h or 1d for data over many days. | |
| entitySelector | No | Entity selector to filter metrics data. CRITICAL: Only ONE entity type per query. Use discover_entities() first to get exact names/IDs, then use entityId("exact-id") or type(SERVICE),entityName.equals("exact-name"). Examples: entityId("SERVICE-123"), type(SERVICE),entityName("payment-service"), type(AWS_LAMBDA_FUNCTION),tag("AWS_REGION:us-west-2") | |
| metricSelector | Yes | Metric selector (e.g., "builtin:service.response.time" for latency, "builtin:tech.generic.cpu.usage" for container CPU, "builtin:host.mem.usage" for memory). Consider first using the tool list_available_metrics to identity the right metric. | |
| environment_alias | Yes | Specify which environment to be queried, by supplying the environment alias as returned by get_environments_info. Can use `ALL_ENVIRONMENTS` to retrieve data from all environments in one request to MCP. |