You may create a test using one of the following options:
Create a test from a template:
Hover over one of the pre-populated templates and click View Template. This opens a side panel displaying pre-populated configuration information, including: Test Details, Request Details, Assertions, Alert Conditions, and Monitor Settings.
Click +Create Test to open the Define Request page, where you can review and edit the pre-populated configuration options. The fields presented are identical to those available when creating a test from scratch.
Click Save Details to submit your API test.
Build a test from scratch:
テストを一から作成するには、+ Start from scratch テンプレートをクリックし、ICMP リクエストタイプを選択します。
テストを実行するドメイン名または IP アドレスを指定します。
Track number of network hops (TTL) (ネットワークホップ数 (TTL) の追跡) を選択または選択解除します。このオプションを選択すると、“traceroute” プローブをオンにして、ホストの宛先へのパスに沿ったすべてのゲートウェイを検出します。
テストセッションごとにトリガーする Number of Pings (Ping の数) を選択します。 デフォルトでは、ping の数は 4 に設定されています。この数値は、減らすか最大 10 まで増やすかを選択できます。
Test Host をクリックして、リクエストの構成をテストします。画面の右側に応答プレビューが表示されます。
8. Click Create Test to submit your API test.
スニペット
When setting up a new Synthetic Monitoring API test, use snippets to automatically fill in basic auth, performance, and regions, rather than selecting these options manually. The following snippets are available:
Basic Auth: Automatically test your APIs using pre-populated basic auth headers, JavaScript, bearer token, and API/app key auth variables.
Performance: Automatically configure a test with the shortest frequency (one minute), perform a gRPC health check, and test for overall response time latency with a breakdown of network timing.
Regions: Automatically test your API endpoint against a location in each of the three primary geographic regions (AMER, APAC and EMEA).
アサーションを定義する
アサーションは、期待されるテスト結果が何であるかを定義します。Test URL をクリックすると、latency、packet loss、packet received の基本的なアサーションが追加されます。テストで監視するには、少なくとも 1 つのアサーションを定義する必要があります。
タイプ
集計
演算子
値の型
レイテンシー
avg、max、min または stddev (別名 jitter)
is less than、is less than or equal、 is、is more than、is more than or equal
整数 (ms)
パケットロス
-
is less than、is less than or equal、is、is more than、is more than or equal
パーセント (%)
受信したパケット
-
is less than、is less than or equal、is、is more than、is more than or equal
integer
ネットワークホップ
-
is less than、is less than or equal、is、is more than、is more than or equal
integer
New Assertion を選択するか、応答プレビューを直接選択することで、API テストごとに最大 20 個のアサーションを作成できます。
To create a local variable, click Create a Local Variable. 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.