Dynatrace Integration
Overview
Dynatrace integration for querying APM data during Root Cause Analysis. Dynatrace is a REMOTE service. Use ONLY the query_dynatrace API tool. All data is accessed via a single unified tool with resource_type parameter.
Instructions
Tool Usage
query_dynatrace(resource_type=TYPE, query=SELECTOR, time_from=START, time_to=END, limit=N)
Resource Types
'problems' -- Active/recent problems. query=problem selector e.g. status("open")
'entities' -- Monitored hosts/services/processes. query=entity selector e.g. type("HOST")
'logs' -- Log entries. query=search string
'metrics' -- Metric time series. query=metric selector e.g. builtin:host.cpu.usage
Selector Syntax
- Problem selectors:
status("open"), status("closed"), severityLevel("ERROR")
- Entity selectors:
type("HOST"), type("SERVICE"), type("APPLICATION"), type("PROCESS_GROUP")
- Metric selectors:
builtin:host.cpu.usage, builtin:host.mem.usage, builtin:service.response.time
Time Format
- Use Dynatrace relative time:
now-1h, now-2h, now-24h
- Default time_from is
now-2h
Examples
- Problems:
query_dynatrace(resource_type='problems', query='status("open")', time_from='now-1h')
- Metrics:
query_dynatrace(resource_type='metrics', query='builtin:host.cpu.usage', time_from='now-30m')
- Entities:
query_dynatrace(resource_type='entities', query='type("HOST")', time_from='now-1h')
- Logs:
query_dynatrace(resource_type='logs', query='error', time_from='now-1h')
RCA Investigation Workflow
Step 1 -- Check active problems:
Start with problems to understand the current issue landscape.
query_dynatrace(resource_type='problems', query='status("open")', time_from='now-2h')
Step 2 -- Drill into affected entities:
Identify which hosts, services, or processes are impacted.
query_dynatrace(resource_type='entities', query='type("HOST")', time_from='now-2h')
Step 3 -- Search logs for errors:
Find error messages around the alert time.
query_dynatrace(resource_type='logs', query='ERROR', time_from='now-1h')
Step 4 -- Query metrics for resource patterns:
Check CPU, memory, and response time metrics for anomalies.
query_dynatrace(resource_type='metrics', query='builtin:host.cpu.usage', time_from='now-1h')
Important Rules
- Dynatrace is a REMOTE service. Use ONLY the
query_dynatrace API tool.
- The
resource_type parameter is required and must be one of: problems, logs, metrics, entities.
- Start with
problems to understand the issue, then drill into entities and logs.
- Token scopes matter:
logs.read is required for log queries, metrics.read for metric queries. A 403 error indicates a missing scope.
- A 400 error typically means an invalid selector query. Check the syntax.
- Results are truncated at the output size limit. Use narrower time ranges to stay within limits.
1---2name: dynatrace3description: Dynatrace APM integration for querying problems, logs, metrics, and monitored entities during RCA investigations4---56# Dynatrace Integration78## Overview9Dynatrace integration for querying APM data during Root Cause Analysis. Dynatrace is a REMOTE service. Use ONLY the `query_dynatrace` API tool. All data is accessed via a single unified tool with `resource_type` parameter.1011## Instructions1213### Tool Usage14`query_dynatrace(resource_type=TYPE, query=SELECTOR, time_from=START, time_to=END, limit=N)`1516### Resource Types171. `'problems'` -- Active/recent problems. query=problem selector e.g. `status("open")`182. `'entities'` -- Monitored hosts/services/processes. query=entity selector e.g. `type("HOST")`193. `'logs'` -- Log entries. query=search string204. `'metrics'` -- Metric time series. query=metric selector e.g. `builtin:host.cpu.usage`2122### Selector Syntax23- Problem selectors: `status("open")`, `status("closed")`, `severityLevel("ERROR")`24- Entity selectors: `type("HOST")`, `type("SERVICE")`, `type("APPLICATION")`, `type("PROCESS_GROUP")`25- Metric selectors: `builtin:host.cpu.usage`, `builtin:host.mem.usage`, `builtin:service.response.time`2627### Time Format28- Use Dynatrace relative time: `now-1h`, `now-2h`, `now-24h`29- Default time_from is `now-2h`3031### Examples32- Problems: `query_dynatrace(resource_type='problems', query='status("open")', time_from='now-1h')`33- Metrics: `query_dynatrace(resource_type='metrics', query='builtin:host.cpu.usage', time_from='now-30m')`34- Entities: `query_dynatrace(resource_type='entities', query='type("HOST")', time_from='now-1h')`35- Logs: `query_dynatrace(resource_type='logs', query='error', time_from='now-1h')`3637## RCA Investigation Workflow3839**Step 1 -- Check active problems:**40Start with problems to understand the current issue landscape.41`query_dynatrace(resource_type='problems', query='status("open")', time_from='now-2h')`4243**Step 2 -- Drill into affected entities:**44Identify which hosts, services, or processes are impacted.45`query_dynatrace(resource_type='entities', query='type("HOST")', time_from='now-2h')`4647**Step 3 -- Search logs for errors:**48Find error messages around the alert time.49`query_dynatrace(resource_type='logs', query='ERROR', time_from='now-1h')`5051**Step 4 -- Query metrics for resource patterns:**52Check CPU, memory, and response time metrics for anomalies.53`query_dynatrace(resource_type='metrics', query='builtin:host.cpu.usage', time_from='now-1h')`5455## Important Rules56- Dynatrace is a REMOTE service. Use ONLY the `query_dynatrace` API tool.57- The `resource_type` parameter is required and must be one of: problems, logs, metrics, entities.58- Start with `problems` to understand the issue, then drill into entities and logs.59- Token scopes matter: `logs.read` is required for log queries, `metrics.read` for metric queries. A 403 error indicates a missing scope.60- A 400 error typically means an invalid selector query. Check the syntax.61- Results are truncated at the output size limit. Use narrower time ranges to stay within limits.