DEV Community

Cover image for Dynatrace synthetic monitoring tutorial: HTTP and browser tests, API, cost and locations
Span Observer
Span Observer

Posted on Originally published at span.observer

Dynatrace synthetic monitoring tutorial: HTTP and browser tests, API, cost and locations

A login page goes down at 3 a.m. Nobody signs in at that hour, so no user complains, and your RUM stays silent for lack of traffic. Dynatrace synthetic monitoring fills that gap: a robot runs the same journey at a fixed interval, from locations you choose, and raises an alert as soon as the result changes.

For an SRE, this is the most stable SLI source there is: same request, same frequency, same starting point. Measured availability does not depend on traffic volume, which makes it ideal for an availability SLO on a critical service, for catching a night-time outage or for validating a deployment before real traffic arrives.

The goal of this tutorial: create an HTTP monitor and a browser monitor, choose between public and private locations, then check through the API that results are coming in. The content applies to Dynatrace SaaS and Dynatrace Managed; differences are flagged along the way.

HTTP or browser: which test should you pick?

The two monitor types do not measure the same thing. Mixing them up leads either to expensive tests or to blind ones.

Criterion HTTP monitor Browser monitor
What runs One or more HTTP requests, no rendering A real browser (Chromium) that loads the page and runs the JavaScript
Typical use API, health endpoint, certificate, redirect Home page, login, checkout (clickpath)
What it catches Status code, response time, expected content JavaScript errors, missing elements, slow rendering
Default frequency via API v2 1 minute 15 minutes

Rule of thumb: one HTTP monitor per critical API, one browser monitor per business journey that brings in money. Everything else belongs to RUM.

Prerequisites

  • A Dynatrace SaaS or Managed environment, with permission to create synthetic monitors.
  • For tests from your internal network: a Linux ActiveGate dedicated to synthetic (installation in step 2). See also choosing between Environment ActiveGate and Cluster ActiveGate.
  • An API token with the metrics.read scope for verification, and syntheticExecutions.write to trigger on-demand executions. If you get 401 or 403, follow the token troubleshooting guide.
  • curl and jq.

Setting up Dynatrace synthetic monitoring step by step

Step 1: choose the locations

A public location is run by Dynatrace in cloud regions: it sees your service the way an internet user does. A private location is an ActiveGate you install yourself: it reaches internal applications behind a VPN or a firewall.

  • Public site, customers in several countries: two or three public locations close to your users.
  • Internal application, intranet, private API: one private location per data centre or network zone.
  • Isolated (air-gapped) Managed environment: only private locations are an option. Check the documentation for your version to see what your cluster offers.

Step 2: install a private location

A private location relies on a Linux ActiveGate with the synthetic capability enabled. Download the ActiveGate installer from your environment, then run it as root:

# ActiveGate with the Synthetic capability enabled (Linux only)
sudo /bin/bash ./Dynatrace-ActiveGate-Linux.sh --enable-synthetic=manual

# Variant: Chrome for Testing installed in a custom directory
sudo CFT_DIR=/custom/path /bin/bash ./Dynatrace-ActiveGate-Linux.sh --enable-synthetic=manual
Enter fullscreen mode Exit fullscreen mode

The browser is required for browser monitors. Watch the distribution: the documentation announces the end of support for synthetic ActiveGates on Red Hat, Oracle Linux and Rocky Linux 8 after a given ActiveGate version. Prefer a recent distribution. Once the ActiveGate is connected, create the private location in the Synthetic settings and assign this ActiveGate to it. Plan for at least two ActiveGates per location: a single-node location becomes a point of failure itself.

Step 3: create an HTTP monitor

From the Synthetic app (or the classic Synthetic page in Managed), create an HTTP monitor and fill in:

  1. the URL under test, for example https://api.example.com/health;
  2. the method and, if needed, headers (a technical token kept in the credential vault, never in plain text);
  3. a content validation: the expected status code and a string present in the response, such as "status":"UP";
  4. the frequency (1 minute for a critical API) and the locations chosen in step 1.

Content validation matters: otherwise a custom error page served with a 200 would count as a success.

Step 4: create a browser monitor

For a journey, record a clickpath: load the page, type the username of a test account, click « Sign in », wait for an element on the next page. Three tips avoid false positives:

  • validate each step on a stable element (an HTML id, not marketing copy that changes);
  • use a dedicated test account with no sensitive rights, kept out of business statistics;
  • keep a reasonable frequency (15 minutes by default): a browser monitor consumes licence.

Step 5: tune outage detection

In the monitor settings, outage handling separates global outages (all locations fail) from local outages (one location fails several times in a row). Requiring two or three consecutive failures before opening a problem removes most network noise. To cut useless alerts further, see how to reduce Davis alert noise.

Dynatrace synthetic monitoring cost, licence and MFA journeys

Under the Dynatrace Platform Subscription (DPS), the two monitor types are not billed the same way. An HTTP monitor consumes synthetic requests: one per HTTP(S) request executed, per run and per location, and the documentation states that a public or private location makes no difference. A browser monitor or clickpath consumes synthetic actions: a step counts only if it triggers at least one web request, so a scroll or a click that sends nothing is not billed. The quick estimate is therefore billable steps × runs per hour × locations; the exact rate depends on your rate card, and the real figure is in Account Management.

Journeys protected by multi-factor authentication need a different recording approach: the Dynatrace Synthetic Recorder guide for private locations and MFA covers that case.

How to check that it works

After a few cycles, query the per-location availability metric. The call works on SaaS and on Managed (on Managed, the URL looks like https://<your-domain>/e/<env-id>):

export DT_URL="https://<env-id>.live.dynatrace.com"
curl -s -G "$DT_URL/api/v2/metrics/query" \
  -H "Authorization: Api-Token $DT_API_TOKEN" \
  --data-urlencode 'metricSelector=builtin:synthetic.http.availability.location.total' \
  --data-urlencode 'from=now-2h' | jq '.result[0].data[0].values[-5:]'
Enter fullscreen mode Exit fullscreen mode

For browser monitors, the equivalent metric is builtin:synthetic.browser.availability.location.total. Values close to 100 show that the monitor runs and succeeds; no values at all point to a disabled monitor or a location that runs nothing.

To test right after a deployment, trigger an on-demand execution:

curl -s -X POST "$DT_URL/api/v2/synthetic/executions/batch" \
  -H "Authorization: Api-Token $DT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"monitors":[{"monitorId":"HTTP_CHECK-0123456789ABCDEF"}],"processingMode":"EXECUTIONS_DETAILS_ONLY"}'
Enter fullscreen mode Exit fullscreen mode

The EXECUTIONS_DETAILS_ONLY mode returns the result without opening a problem: handy in a CI/CD pipeline. Finally, check on the monitor page that every location shows recent executions.

Best practices

  • One SLO per critical journey: synthetic availability gives a stable SLI, even at night. Combine it with RUM to cover real-world slowness too (see user journey SLOs).
  • Test from where your users are: a single location in the same data centre as the application does not measure much.
  • Version your monitors with configuration as code, so you can recreate them identically across environments.
  • Watch certificates: an HTTP monitor can fail on an SSL warning, which gives notice before expiry.
  • Quarterly review: delete orphaned monitors; they cost licence and raise alerts nobody reads.

Frequently asked questions

Does synthetic monitoring replace RUM?

No. Synthetic measures a controlled scenario at a fixed frequency; RUM measures what real users experience, on their devices and networks. The first detects the outage, the second measures the experience. They complement each other.

Can you use public locations with Dynatrace Managed?

It depends on your cluster’s configuration and connectivity. In an isolated cluster, only private locations work. Check the list of locations offered in your environment and the documentation for your version.

Why does a browser monitor fail when the site works?

Most often, an element selector changed after a release, or a cookie banner hides the button. Look at the screenshot of the failing step, then update the clickpath with a more stable selector.

Conclusion

One HTTP monitor per critical API, one browser monitor per journey that matters, locations close to your users and private locations for internal apps: with these four decisions, you catch an outage before the first customer ticket. Then wire synthetic availability into an SLO, and the next night-time outage will have a witness.

span.observer is an independent community blog, not affiliated with Dynatrace LLC. Dynatrace is a trademark of its owner. Screen, metric and option names change over time: check them in the official documentation for your version.


Originally published on span.observer. French version: https://span.observer/fr/monitoring-synthetique-dynatrace-http-navigateur/.

Top comments (0)