---
title: "Datadog & Dynatrace (APM)"
section: "Integrations"
description: "Connect Datadog or Dynatrace to SmartestQA: keys and scopes, watched metrics and presets, server metrics in load test reports, run events, test buttons and limits."
url: https://docs.smartestqa.ai/en/integrations-apm.html
audience: [customer, admin]
updated: 2026-11-08
keywords: "apm datadog dynatrace api key application key access token metrics.read events.ingest timeseries_query load test report server metrics events presets metric selector entity selector"
---
# Integrations: Datadog and Dynatrace (APM)

An APM connection works both ways. SmartestQA reads the metrics you watch for the time a load test ran and draws them under its charts, and writes run start, finish and failure events into your APM. Nothing is installed on your servers.

## In short

**On this page you can**

- Read Datadog or Dynatrace metrics into every load test report for the run’s time window.
- Add CPU, memory, latency and error metrics from presets with your service or host name.
- Write pipeline start, finish and failure events into Datadog or Dynatrace.
- Preview the last hour of each metric before you rely on it.
- Keep report charts after the APM’s own retention ends: finished runs are saved.

**How to use it**

1. Create a Datadog API key and Application key, or a Dynatrace token with the two scopes.
2. Click Connect Datadog or Connect Dynatrace and enter site and keys.
3. Enter a service or host name and click Add from presets .
4. Click Test Connection , then Save , then Preview last hour .
5. Run a load test and open its report: Server metrics (APM) appears.

## Before you start

| APM | Credentials | Permissions | Address |
| --- | --- | --- | --- |
| Datadog | **API key** (Organization Settings › API Keys) and **Application key** | The Application key needs `timeseries_query` to read metrics | **Datadog site**: US1, US3, US5, EU1, AP1, AP2 or US1-FED, or **Custom API URL…** |
| Dynatrace | **API token** (Access tokens) | `metrics.read` to read metrics, `events.ingest` to send events | **Environment URL**: SaaS `https://{id}.live.dynatrace.com`, Managed `https://{host}/e/{environment-id}` |

The Datadog site is the part after `app.` in your Datadog address: `app.datadoghq.eu` → `datadoghq.eu`. Datadog and Dynatrace SaaS addresses must use `https`; a Dynatrace Managed address inside your network may use `http`.

## Connect an APM

1. **Open the dialog**

   Go to **Integrations** › **Datadog** (or Dynatrace). The page is titled **APM · Datadog & Dynatrace**. Click **Connect Datadog**, **Connect Dynatrace** or **Add APM connection**.
2. **Enter the connection**

   Choose the **Provider**, give it a **Name**, pick the site or enter the environment URL, and paste the keys. Keep **Read metrics into load test reports** and **Send run start / end events** on as you need. Optionally add **Extra event tags (optional)** and, for Dynatrace, **Attach events to (entity selector, optional)**.
3. **Add watched metrics**

   Under **Watched metrics** enter the **Service name** and, for Dynatrace host metrics, the **Host name**. Click **Add from presets**, or **Custom** to write your own query. Up to 20 metrics.
4. **Test and save**

   Click **Test Connection**, then **Save**.

   “Datadog: API key and Application key accepted” or “Dynatrace: token accepted (metrics.read)”.
5. **Check the data**

   Open the connection again and click **Preview last hour** on the metrics. Each shows its latest value, or “No data in this window”. On the page, **Send test event** writes a “SmartestQA test event” into the APM: “Test event sent. It should appear in the APM event stream within a minute.”

## Preset metrics

`{SERVICE}` and `{HOST}` are replaced by the names you enter.

| Datadog preset | Query | Dynatrace preset | Metric selector |
| --- | --- | --- | --- |
| CPU (user) | `avg:system.cpu.user{service:{SERVICE}}` | Host CPU usage | `builtin:host.cpu.usage` |
| Memory used | `avg:system.mem.pct_usable{service:{SERVICE}}` | Host memory usage | `builtin:host.mem.usage` |
| Request duration (avg) | `avg:trace.http.request.duration{…}` | Service response time | `builtin:service.response.time` |
| Request duration (p95) | `p95:trace.http.request{…}` | Service failure rate | `builtin:service.errors.total.rate` |
| Request errors | `sum:trace.http.request.errors{…}.as_count()` | Service requests | `builtin:service.requestCount.total` |
| Requests | `sum:trace.http.request.hits{…}.as_count()` | JVM GC suspension | `builtin:tech.jvm.memory.gc.suspensionTime` |
| JVM heap used | `avg:jvm.heap_memory{…}` | Database response time | `builtin:service.dbChildCallTime` |
| DB query duration | `avg:trace.postgres.query.duration{…}` |  |  |

Dynatrace presets add an entity selector such as `type(SERVICE),entityName.contains("payments")`. Datadog `trace.*` metrics exist only where the Datadog Agent with APM is installed.

## Server metrics in load test reports

When a [load test report](https://docs.smartestqa.ai/en/report-load-tests.html) opens, SmartestQA reads each watched metric for the run window and draws it in the **Server metrics (APM)** panel under the load charts. The shaded band marks when the test ran; each chart shows avg and max.

- **Window**: from one minute before the run started to one minute after it ended (a run shorter than a minute counts as one minute). See [the formula](https://docs.smartestqa.ai/en/integrations-numbers.html#apm-window).
- **Saved with the report**: once the window ended more than 5 minutes ago, the series are saved, marked “saved with the report”, and shown even after your APM’s retention ends. While the run is still in progress the panel says “run still in progress”.
- **Changing a connection** (save or delete) clears the saved series of the project, so reports read the metrics again with the new settings.
- **Manage** on the panel opens this integration page.

## Events into your APM

With **Send run start / end events** on, every [pipeline](https://docs.smartestqa.ai/en/schedule-create.html) start, finish and failure in the project becomes an event: in Datadog with the tag `source:smartestqa` plus your extra tags, in Dynatrace as a `CUSTOM_INFO` event attached to the environment or to your entity selector. [Load tests](https://docs.smartestqa.ai/en/automate-steps-load.html) run in pipelines, so they are marked too. Overlay these events on your dashboards to see when a test was running. The page shows **Run events**: “Sent on start, finish and failure” with the last time, or “Not sent”.

## Limits

| Item | Limit |
| --- | --- |
| Watched metrics per connection | 20 |
| Report window | Run time + 1 min on each side, at most 24 hours |
| Preview | Last hour |
| Request timeouts | 10 s to connect, 20 s per call |

Keys are stored encrypted and never shown again. If you change the provider or the address, re-enter the API key (and the Datadog Application key): “The address changed: re-enter the API key… to use them with the new address”.

## If something goes wrong

- [“Authentication failed (401): check the API key”](https://docs.smartestqa.ai/en/integrations-troubleshooting.html#fix-apm-401)
- [“Permission denied (403): …”](https://docs.smartestqa.ai/en/integrations-troubleshooting.html#fix-apm-403)
- [“API key is valid but the Application key is missing…”](https://docs.smartestqa.ai/en/integrations-troubleshooting.html#fix-apm-appkey)
- [“The APM returned no data for this run window.”](https://docs.smartestqa.ai/en/integrations-troubleshooting.html#fix-apm-nodata)
- [“Datadog / Dynatrace SaaS addresses must use https”](https://docs.smartestqa.ai/en/integrations-troubleshooting.html#fix-apm-https)
