HTTP リクエストを作成し、アサーションを追加するには、 HTTP テストのドキュメントを参照してください。アサーションはマルチステップ API テストでは任意です。
gRPC リクエストを作成し、動作チェックまたはヘルスチェックのためのアサーションを追加するには、 gRPC テストのドキュメントを参照してください。アサーションはマルチステップ API テストでは任意です。
実行設定を追加
Execution Settings の下で、以下のオプションが利用できます。
ステップの成功:
ステップが成功した後に後続のステップを続行するには、 If step succeeds, continue to next step をクリックします。
ステップが成功した後にテストを終了するには、 If step succeeds, exit test and mark it as passed をクリックします。これにより、不要なステップの実行を防ぎ、テストが失敗としてマークされるのを回避します。
ステップの失敗
ステップが失敗した場合に後続のステップを実行するには、If step fails, continue to next step をクリックします。これは、後続のステップを実行したい場合のクリーンアップタスクに役立ちます。例えば、テストがリソースを作成し、そのリソースに対していくつかの操作を行い、最後にそのリソースを削除する場合などです。
Set alert conditions to determine the circumstances under which you want a test to fail and trigger an alert.
Alerting rule
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:
At least one location was in failure (at least one assertion failed) during the last X minutes;
At one moment during the last X minutes, at least n locations were in failure.
Fast retry
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.
Configure the test monitor
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.
To create a local variable, click + All steps > Variables. You can select one of the following available builtins to add to your variable string:
{{ numeric(n) }}
Generates a numeric string with n digits.
{{ alphabetic(n) }}
Generates an alphabetic string with n letters.
{{ alphanumeric(n) }}
Generates an alphanumeric string with n characters.
{{ date(n unit, format) }}
Generates a date in one of Datadog’s accepted formats with a value corresponding to the UTC date the test is initiated at + or - n units.
{{ timestamp(n, unit) }}
Generates a timestamp in one of Datadog’s accepted units with a value corresponding to the UTC timestamp the test is initiated at +/- n units.
{{ uuid }}
Generates a version 4 universally unique identifier (UUID).
{{ public-id }}
Injects the Public ID of your test.
{{ result-id }}
Injects the Result ID of your test run.
To obfuscate local variable values in test results, select Hide and obfuscate variable value. Once you have defined the variable string, click Add Variable.
TIMEOUT: The request couldn't be completed in a reasonable time. は、リクエストの持続時間がテスト定義のタイムアウト (デフォルトは 60 秒に設定されています) に当たったことを示します。
各リクエストについて、ネットワークウォーターフォールに表示されるのは、リクエストの完了したステージのみです。例えば、Total response time だけが表示されている場合、DNS の解決中にタイムアウトが発生したことになります。
TIMEOUT: Overall test execution couldn't be completed in a reasonable time. は、リクエストおよびアサーションの処理時間が最大許容時間 (30 分) に達したことを示しています。