![]() |
VOOZH | about |
Multistep API tests allow you to chain several API tests at once to proactively monitor and ensure that the sophisticated journeys on your key services are available at anytime, and from anywhere. If you want to perform single requests to your services, use API tests.
You can accomplish the following:
If one of your services starts answering more slowly, or in an unexpected way (for example, unexpected response body or status code), your test can alert your team, block your CI pipeline, or even roll back the faulty deployment.
Multistep API tests can run from Datadog managed and private locations, allowing full coverage of your systems, both external and internal.
env and other tags to your Multistep API test. You can use these tags to filter through your Synthetic tests on the Synthetic Monitoring & Continuous Testing page.Select the Locations for your Multistep API test. Multistep API tests can run from both managed and private locations depending on your preference for running the test from outside or inside your network.
Datadog’s out-of-the-box managed locations allow you to test public-facing websites and endpoints from regions where your customers are located.
AWS:
| Americas | Asia Pacific | EMEA |
|---|---|---|
| Canada Central | Hong Kong | Bahrain |
| Northern California | Jakarta | Cape Town |
| Northern Virginia | Mumbai | Frankfurt |
| Ohio | Osaka | Ireland |
| Oregon | Seoul | London |
| São Paulo | Singapore | Milan |
| Sydney | Paris | |
| Tokyo | Stockholm |
GCP:
| Americas | Asia Pacific | EMEA |
|---|---|---|
| Dallas | Tokyo | Frankfurt |
| Los Angeles | ||
| Oregon | ||
| Virginia |
Azure:
| Region | Location |
|---|---|
| Americas | Virginia |
The Datadog for Government site (US1-FED) uses the following managed location:
| Region | Location |
|---|---|
| Americas | US-West |
To create an API request step, click Create Your First Step.
By default, you can create up to 10 test steps. To increase this limit, contact Datadog Support.
Name your step.
Choose a request type:
See the HTTP Tests documentation to create an HTTP request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the gRPC Tests documentation to create a gRPC request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the SSL Tests documentation to create an SSL request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the DNS Tests documentation to create a DNS request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the WebSocket Tests documentation to create a WebSocket request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the TCP Tests documentation to create a TCP request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the UDP Tests documentation to create a UDP request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
See the ICMP Tests documentation to create an ICMP request and add assertions for a behavior check or a health check. Assertions are optional in multistep API tests.
Under Execution Settings, the following options are available:
Click If step succeeds, continue to next step to let your test proceed with subsequent steps after successful steps.
Click If step succeeds, exit test and mark it as passed to exit the test after a successful step completion. This prevents running unnecessary steps and avoids marking the test as failed.
Click If step fails, continue to next step to proceed with subsequent steps after step failure. This can be useful for clean-up tasks when you want subsequent steps to proceed. For example, a test may create a resource, perform several actions on that resource, and end with the deletion of that resource.
In case one of the intermediary steps fail, you want to have this setting enabled on every intermediary step to ensure that the resource is deleted at the end of the test and that no false positives are created.
The test generates an alert if an endpoint does not answer as expected. Your test can trigger retries X times after Y ms in case of a failed test result. Customize the retry interval to suit your alerting sensibility.
Optionally, extract variables from the response of your API request by parsing its response headers or body. The value of the variable updates each time the API request step runs.
To start parsing a variable, click Extract a variable from response content:
Enter a Variable Name. Your variable name can only use uppercase letters, numbers, and underscores and must have at least three characters.
Decide whether to extract your variable from the response headers or from the response body.
You can extract up to ten variables per test step. Once created, this variable can be used in the following steps of your multistep API test. For more information, see Use variables.
Multistep API tests can run:
Set alert conditions to determine the circumstances under which you want a test to fail and trigger an alert.
When you set the alert conditions to: An alert is triggered if any assertion fails for X minutes from any n of N locations, an alert is triggered only if these two conditions are true:
Your test can trigger retries X times after Y ms in case of a failed test result. Customize the retry interval to suit your alerting sensibility.
Location uptime is computed on a per-evaluation basis (whether the last test result before evaluation was up or down). The total uptime is computed based on the configured alert conditions. Notifications sent are based on the total uptime.
A notification is sent by your test based on the alerting conditions previously defined. Use this section to define how and what to message your team.
Similar to how you configure monitors, select users and/or services that should receive notifications either by adding an @notification to the message or by searching for team members and connected integrations with the dropdown menu.
Enter the notification message for your test or use pre-filled monitor messages. This field allows standard Markdown formatting and supports the following conditional variables:
| Conditional Variable | Description |
|---|---|
{{#is_alert}} | Show when the test alerts. |
{{^is_alert}} | Show unless the test alerts. |
{{#is_recovery}} | Show when the test recovers from alert. |
{{^is_recovery}} | Show unless the test recovers from alert. |
{{#is_renotify}} | Show when the monitor renotifies. |
{{^is_renotify}} | Show unless the monitor renotifies. |
{{#is_priority}} | Show when the monitor matches priority (P1 to P5). |
{{^is_priority}} | Show unless the monitor matches priority (P1 to P5). |
Notification messages include the message defined in this section and information about the failing locations. Pre-filled monitor messages are included in the message body section:
Specify how often you want your test to re-send the notification message in case of test failure. To prevent renotification on failing tests, check the option Stop re-notifying on X occurrences.
Click Save & Start Recording to save your test configuration and monitor.
For more information, see Synthetic Monitoring notifications.
To pause test execution during planned maintenance windows, select an existing Scheduled downtime in the Downtimes section. The test automatically pauses during the downtime’s scheduled time slots.
Note: You cannot create a new downtime from the test creation form. To create one, navigate to Settings > Downtimes.
To create a local variable, click + All steps > Variables. You can select one of the following available builtins to add to your variable string:
n digits.n letters.n characters.n units.n units.To obfuscate local variable values in test results, select Hide and obfuscate variable value. Once you have defined the variable string, click Add Variable.
In addition to creating local variables, you can extract variables from any step of your multistep API test and re-inject the values in subsequent steps.
You can use the global variables defined in the Settings and the locally defined variables in the URL, advanced options, and assertions of your API tests.
To display your list of variables, type {{ in your desired field.
Multistep API tests support subtests, allowing you to reuse existing Multistep API tests or extract steps into reusable components. You can nest subtests up to two levels deep.
To use an existing Multistep API test as a subtest, click Subtest, go to the From Existing Test tab, and select a Multistep API test from the dropdown menu.
To convert steps from your current Multistep API test into a subtest, click on the Extract From Steps tab, select the recorded steps you want to extract, and click Convert to Subtest.
To override a subtest variable in a Multistep API test, define it in the parent test using the same name. A variable always uses the first value assigned to it.
If you don’t need to run a subtest independently, you can pause it. It still runs as part of the Multistep API test but is not executed on its own.
Note: Only Multistep API tests can be added as subtests. Using API tests as subtests is not supported.
A test is considered FAILED if a step does not satisfy one or several assertions or if a step’s request prematurely failed. In some cases, the test can indeed fail without being able to test the assertions against the endpoint, these reasons include:
CONNREFUSEDCONNRESETDNSINVALID_REQUESTSSLTIMEOUTTIMEOUT can happen:TIMEOUT: The request couldn't be completed in a reasonable time. indicates that the request duration hit the test defined timeout (default is set to 60s).
For each request only the completed stages for the request are displayed in the network waterfall. For example, in the case of Total response time only being displayed, the timeout occurred during the DNS resolution.TIMEOUT: Overall test execution couldn't be completed in a reasonable time. indicates that the request and assertions duration hit the maximum duration (30 minutes).For a complete list of other API test error codes, see API Testing Errors.
By default, only users with the Datadog Admin and Datadog Standard roles can create, edit, and delete Synthetic multistep API tests. To get create, edit, and delete access to Synthetic multistep API tests, upgrade your user to one of those two default roles.
If you are using the custom role feature, add your user to any custom role that includes synthetics_read and synthetics_write permissions for Synthetic Monitoring.
Access restriction is available for customers using custom roles on their accounts.
You can restrict access to a multistep API test based on the roles in your organization. When creating a multistep API test, choose which roles (in addition to your user) can read and write your test.
Additional helpful documentation, links, and articles:
| |