Overview

The APM integration with Synthetic Monitoring allows you to go from a test run that potentially failed to the root cause of the issue by looking at the trace generated by that test run.

Having network-related specifics (thanks to your test) as well as backend, infrastructure, and log information (thanks to your trace) allows you to access a new level of details about the way your application is behaving, as experienced by your user.

Usage

Statements on this page apply to HTTP API tests, Multistep API tests, and browser tests for APM.

Prerequisites

  • Your service, and the endpoint your test is running on, is traced on the APM side.
  • Your service uses an HTTP server.
  • Your HTTP server is using a library that supports distributed tracing.

Create a test that hits your traced HTTP server, and Datadog automatically links the trace generated by your server to the corresponding test result.

To link browser test results, allow the URLs you want the APM integration headers added to. You can do this in Synthetic Settings. Use * for wildcards:

https://*.datadoghq.com/*

Supported libraries

The following Datadog tracing libraries are supported:

How are traces linked to tests?

Datadog uses the distributed tracing protocol and sets up the following HTTP headers:

x-datadog-trace-id
Generated from the Synthetic Monitoring backend. Allows Datadog to link the trace with the test result.
x-datadog-parent-id: 0
To have Synthetic tests be the root span of the generated trace.
x-datadog-origin: synthetics
To identify generated traces from your API tests. Spans from these traces are tagged with ingestion_reason:synthetics.
x-datadog-origin: synthetics-browser
To identify generated traces from your Browser tests. These traces are tagged with ingestion_reason:synthetics-browser.
x-datadog-sampling-priority: 1
To make sure that the Agent keeps the trace.
traceparent: [version]-[trace id]-[parent id]-[trace flags]
version: The specification assumes version is set to 00.
trace id: 128 bits trace ID, hexadecimal on 32 characters. The source trace ID is 64 bits to maintain compatibility with APM.
parent id: 64 bits span ID, hexadecimal on 16 characters.
trace flags: Sampled (01) or not sampled (00)
Example:
traceparent: 00-00000000000000008448eb211c80319c-b7ad6b7169203331s-01

How long are traces retained?

These traces are retained for 15 days with the Synthetics Default retention filter, just like your classical APM traces.

Further Reading