Dynatrace Integration
Connect Dynatrace so that agents can investigate incidents with Davis problems, metrics, logs, distributed traces, business events, RUM user sessions, monitored entities (Smartscape topology), change events, and dashboards & notebooks (Document Service). You can also forward Dynatrace Davis problems to Autoheal through a problem-notification webhook. Autoheal ingests and groups these problems, and makes them available for triage on the Alerts page.
Capabilities
Once connected, agents can:
| Capability | Description |
|---|---|
| List/Get Problems | Review Davis-correlated problems, their root cause, impact, and affected entities |
| Query Metrics | Query metrics from Grail using DQL (timeseries) |
| Query Logs | Query logs on Grail using DQL (fetch logs) |
| Query Traces | Query distributed traces / spans on Grail (fetch spans) to follow latency and errors across services |
| Query Business Events | Query business events on Grail (fetch bizevents) to correlate system health with business-transaction volume |
| Query User Sessions | Query RUM user sessions on Grail (fetch user.sessions) to find the customers/sessions impacted by an incident |
| List Entities | Navigate Smartscape topology — hosts, services, applications, Kubernetes clusters, and more |
| Query Events | Query change events on Grail (fetch events) — deployments, configuration changes, availability, custom events — the "what changed" timeline (distinct from Davis problems) |
| List Alerting Rules | Read the configured alerting rules — classic metric events and Grail DQL custom alerts (Davis anomaly detectors) — for alert-definition sync |
| List SLOs | Read service-level objectives — targets, warning thresholds, timeframes — from the Grail-native SLO Service API |
| List/Get Documents | List dashboards & notebooks from the Document Service. Get a document's full definition (each tile/section and the DQL query behind it) to reconstruct or re-run a dashboard during an investigation |
| Query Grail (generic) | Run read-only DQL for Grail data types without a dedicated tool — security events, RUM user events/replays, entities, Smartscape topology, system events |
| Alert Source Webhooks | Receive Davis problem OPEN and RESOLVED notifications via webhook |
How Authentication Works
Dynatrace exposes two API planes, and both are required. The API token covers Davis problems, entities, and alerting rules. The OAuth client covers all Grail data (logs, metrics, traces, business events, change events, user sessions, SLOs, and dashboards & notebooks). Log/metric/trace access is the core of the integration and is only reachable through Grail. For this reason, the OAuth client is mandatory:
| Credential | Required? | Used for | Why |
|---|---|---|---|
| API token | Required | Problems, entities, alerting rules (Environment API v2) + alert webhooks | The Environment API plane |
| OAuth client (client id + secret + account URN) | Required | Logs, metrics, traces, business events, change events, user sessions (Grail DQL Query API) + service-level objectives (SLO Service API) + dashboards & notebooks (Document Service) | Grail data requires an OAuth bearer token. The classic metrics.read / events.read / slo.read token scopes cannot be granted on Grail tenants. This credential needs a Grail-enabled SaaS environment. |
This integration requires a Grail-enabled Dynatrace SaaS environment and both credentials — the API token and the OAuth client. Access to logs, metrics, and traces is the core of the integration and is only possible through Grail via the OAuth client. So OAuth is mandatory. Dynatrace Managed / non-Grail tenants are not supported (they have no Grail/OAuth plane).
Prerequisites
- A Grail-enabled Dynatrace SaaS environment (Dynatrace Managed / non-Grail is not supported)
- Permission to create both an API access token and an OAuth client in your Dynatrace account (both are required)
- Your Dynatrace account URN (
urn:dtaccount:<account-uuid>)
Setup
- Create an API Access Token
- In Dynatrace, open the Access Tokens page. On Grail-native tenants, press Cmd/Ctrl + K and search "Access Tokens". On an older/classic SaaS UI, the page is under Settings → Access tokens. Then click Generate new token
- Name it (e.g., "Autoheal")
- Select these scopes:
problems.read(Read problems)entities.read(Read entities)settings.read(Read settings — for metric events)
- Generate and copy the token (starts with
dt0c01.)



- Create an OAuth Client (required — for Grail data)
Required. Grail (logs/metrics/traces/business-events/change-events/sessions/SLOs) is only reachable through this OAuth client, so the integration can't be saved without it. Requires a Grail-enabled SaaS environment.
- In Account Management (
account.dynatrace.com) → Identity & access management → OAuth clients - Create a new client and grant it Dynatrace's read-only scope set. The full recommended list is in For full functionality below. Autoheal mints the token without listing scopes, so it uses exactly what you grant. Grant the full set to enable every tool. If you prefer least privilege, grant a subset (e.g.
storage:buckets:read+storage:logs:readfor logs,slo:slos:readfor SLOs). - Copy the client ID (starts with
dt0s02.) and client secret (shown only once) - Note your account URN —
urn:dtaccount:<account-uuid>(found in Account Management)
- In Account Management (
- Add the Integration in Autoheal
- Go to Integrations in Autoheal and click Dynatrace
- Enter a name (e.g., "Production Dynatrace")
- Configure Credentials
Enter the following:
- Environment URL (required): e.g.
https://abc12345.live.dynatrace.com - API Token (required): the
dt0c01.token from step 1 - OAuth Client ID (required): the
dt0s02.client id from step 2 - OAuth Client Secret (required): the client secret from step 2
- OAuth Account URN (required):
urn:dtaccount:<account-uuid>
All five fields are required — the integration needs both the Environment API (token) and Grail (OAuth) planes.
- Environment URL (required): e.g.
- Test and Save
Click Test Connection, then Save. The check reports the Environment API (token) and Grail (OAuth) planes separately. It fails only on a problem that breaks a whole plane. Such a problem is an Environment API scope error, or OAuth credentials that are incomplete or can't get a token. Each Grail scope that you didn't grant shows as UNAVAILABLE (that tool is disabled), not as a failure. So the check still passes when you grant only the tables you need.
Required Scopes
| Credential | Scope | Why It's Needed |
|---|---|---|
| API token | problems.read | List and read Davis problems |
| API token | entities.read | List monitored entities (Smartscape) |
| API token | settings.read | Read metric-event alerting rules |
| OAuth client | storage:buckets:read | Access the Grail buckets backing every Grail query (required for all of the below) |
| OAuth client | storage:logs:read | Read logs from Grail (fetch logs) |
| OAuth client | storage:metrics:read | Read metrics from Grail (DQL timeseries) |
| OAuth client | storage:spans:read | Read distributed traces from Grail (fetch spans) |
| OAuth client | storage:bizevents:read | Read business events from Grail (fetch bizevents) |
| OAuth client | storage:events:read | Read change events from Grail (fetch events) |
| OAuth client | storage:user.sessions:read | Read RUM user sessions from Grail (fetch user.sessions) |
| OAuth client | slo:slos:read | Read service-level objectives from the Grail-native SLO Service API (GET /platform/slo/v1/slos) — does not require storage:buckets:read |
| OAuth client | document:documents:read | Read dashboards & notebooks from the Document Service (GET /platform/document/v1/documents). Does not require storage:buckets:read. Note: documents are private by default — the OAuth client only sees documents it owns or that are directly shared with it |
Autoheal mints one OAuth token without enumerating scopes, so it uses exactly the scopes granted to the client. A granted scope enables its tool. A scope that is not granted disables only its matching tool, not the rest. Grant the full read-only set below to enable everything.
For full functionality (all tools)
To enable every capability, grant the complete set below. The two credentials are created independently in Dynatrace, then entered together in Autoheal.
1. API access token — open the Access Tokens page (Cmd/Ctrl + K → "Access Tokens", or Settings → Access tokens on an older/classic SaaS UI). Click Generate new token and select all three scopes:
problems.read
entities.read
settings.read
2. OAuth client — go to Account Management (account.dynatrace.com) → Identity & access management → OAuth clients. Create a client and grant Dynatrace's read-only scope set below. The set covers every current tool and gives forward-compatibility as new tools ship. Autoheal mints the token without listing scopes, so it uses whatever you grant (a subset works too):
storage:logs:read
storage:events:read
storage:metrics:read
storage:bizevents:read
storage:system:read
storage:buckets:read
storage:bucket-definitions:read
storage:spans:read
storage:entities:read
storage:smartscape:read
storage:fieldsets:read
storage:user.events:read
storage:user.sessions:read
storage:user.replays:read
storage:security.events:read
storage:files:read
openpipeline:configurations:read
storage:filter-segments:read
automation:workflows:read
automation:rules:read
automation:calendars:read
extensions:definitions:read
extensions:configurations:read
document:documents:read
document:environment-shares:read
document:direct-shares:read
settings:objects:read
settings:schemas:read
slo:slos:read
storage:buckets:read is mandatory for every Grail storage query. The two non-storage services are the exceptions: slo:slos:read (SLO Service API) and document:documents:read (Document Service) do not require it. The OAuth client requires a Grail-enabled Dynatrace SaaS environment. Dynatrace Managed / non-Grail tenants have no Grail plane and are not supported.
3. Enter both credentials in Autoheal (Integrations → Dynatrace):
| Autoheal field | Value | Needed for |
|---|---|---|
| Environment URL | https://<env-id>.live.dynatrace.com | everything |
| API Token | the dt0c01.… token | problems, entities, alerting rules, webhooks |
| OAuth Client ID | the dt0s02.… client id | all Grail tools |
| OAuth Client Secret | the client secret (shown once at creation) | all Grail tools |
| OAuth Account URN | urn:dtaccount:<account-uuid> | all Grail tools |
Then click Test Connection — with the full set granted, every line reports OK — and Save.
Example Queries
Once connected, you can ask an agent:
What Dynatrace problems are open for the checkout service?
Show me CPU usage for the web hosts over the last hour
Search Dynatrace logs for errors on the payment service in the last 30 minutes
Show Dynatrace security events for the payment service in the last hour
Show the slowest checkout-service traces in the last hour
Which customers had frustrated sessions during the outage?
What deployments or config changes happened right before this problem started?
Which service-level objectives are defined and what are their targets?
Pull the "Checkout Golden Signals" dashboard and re-run its tiles for the last 3 hours