New announcements for Serverless, Network, RUM, and more from Dash! New announcements from Dash!

Identify Synthetics Bots

Some parts of your system might not be available to robots without the right identification, or you might want to avoid collecting analytics from Datadog robots. To detect Datadog robots, use:

  • The headers attached to all Datadog robot requests.
  • Datadog’s Synthetics IP ranges.
  • The Advanced options configuration to set custom headers for your API and browser tests. You can also locally add cookies, headers, or basic auth to your API tests and cookies and headers to your browser tests.
  • The window._DATADOG_SYNTHETICS_BROWSER JavaScript variable in your application code.

Headers

Use the header attached to Datadog robots to detect them for your API and browser tests:

The following header is attached to all Datadog API tests robots:

Sec-Datadog: Request sent by a Datadog Synthetics API Test (https://docs.datadoghq.com/synthetics/) - public_id: <SYNTHETICS_TEST_PUBLIC_ID>

The x-datadog-origin: synthetics header is also added to all the requests launched for a Datadog API test.

The following header is attached to all Datadog browser tests robots:

Sec-Datadog: Request sent by a Datadog Synthetics Browser Test (https://docs.datadoghq.com/synthetics/) - public_id: <SYNTHETICS_TEST_PUBLIC_ID>

APM headers

If APM is enabled, other APM specific headers such as x-datadog-trace-id are added to all the requests launched for API tests.

_DATADOG_SYNTHETICS_BROWSER variable

When a Datadog robot is rendering your application, the window._DATADOG_SYNTHETICS_BROWSER variable is set to true. To remove the robot actions from your analytics data, wrap your analytics tool code with the following test:

if (window._DATADOG_SYNTHETICS_BROWSER === undefined) {
  initializeAnalytics()
}

Further Reading