API モニタリングジョブの設定

このページでは、API モニタリングジョブの設定方法について説明します。

API モニタリングジョブには、以下の詳細を設定できます。

  • ジョブをいつ、どこで、どの程度の頻度で実行するかのスケジュール。
  • タイムアウトの設定。
  • 警告イベントおよび重大イベントをトリガーするパフォーマンスしきい値の設定。

Create a Job

  1. On the Controller UI, click User Experience > API Monitoring.
  2. Click Add Collection and specify a collection name.
  3. Click Add.
  4. Select the newly created collection and add a job.

A new job configuration page appears; proceed with the following steps:

API リクエストの設定

API ジョブの名前を指定すると、次のいずれかのオプションによって API リクエストを設定できます。

GUI

ジョブを設定するための JavaScript を手動で作成したくない場合は、[GUI] オプションを使用してジョブを簡単に設定できます。

[GUI] をクリックして API リクエストを設定します。

左側の [API Requests] ペインには、設定する API リクエストが表示されます。作成する API リクエストには Request 1 という名前が付けられ、この名前は後で API リクエストリストビューから編集できます。

  1. 右側のペインから HTTP メソッドを選択します。サポートされているメソッドは、GETPOSTPUT、および DELETE です。
  2. API コールを実行する URL を指定します。
  3. メソッドタイプに基づいて、次の詳細を指定します。
    タブ説明
    設定

    API が別の API にリダイレクトする場合は、[Follow Redirects] オプションを選択します。

    [Follow Redirects] を有効にすると、[Follow Redirects count.] で最大数を指定できます。これは、特定の URL に対してチェックされるリダイレクトの数を示します。

    Response Validation

    アサーションを追加することにより、応答を検証できます。

    たとえば、[Status Code]、[=] を選択して値を 200 と入力すると、ステータスコードが 200 の場合にのみジョブが成功します。同様に、応答コンテンツや応答時間など、複数のアサーションを追加できます。

    パラメータ

    値とともに照会するパラメータを入力します。

    Initialise

    初期変数を作成できます。変数名と値を指定します。その後、次の構文を使用して使用できます。

    {{<variable-name>}}
    ヘッダーヘッダー名と値を、キーと値のペアとして入力します。
    本体

    XML および JSON の本文タイプがサポートされています。

    本文タイプを選択し、詳細を入力します。例:

    { title: "foo" body: "bar", userId: 100, }
    認証

    次の認証タイプがサポートされています。

    • [Basic Auth]:ユーザー名とパスワードを指定します。
    • [Token]:ベアラートークンを指定します。
    • [No Auth]:値は不要です。

    秘密を合成クレデンシャル Vault に保存することもできます。

JavaScript の作成

ジョブ用の JavaScript を作成し、[スクリプトエディタ(Script Editor)] に入力します。

API モニタリングのサンプル JavaScript については、「JavaScript」を参照してください。

Postman からの API コレクションのインポート

Postman の API コレクションを API モニタリングジョブにインポートできます。

コントローラで API コレクションを手動で再度作成する代わりに、Postman の既存の API コレクションをインポートできます。

最初に API コレクションを Postman から JSON ファイルとしてエクスポートしてから、JSON ファイルを API モニタリングジョブにインポートする必要があります。エクスポート時に推奨される [Collection v2.1] を選択します。[Collection v2] としてファイルをエクスポートすることはサポートされていません。

Postman コレクションをインポートするには、次の手順を実行します。

  1. [ImportChoose File] をクリックして、Postman からエクスポートした API コレクション JSON ファイルを選択します。
  2. Import をクリックします。
  3. 成功メッセージが表示されたら、[Script Editor] タブでスクリプトを確認します。
    注: 二重中括弧 {{ }} で囲まれた文字列は変数です。変数は適切な値に手動で置き換える必要があります。

    [User ExperienceAPI Monitoring] に移動して、コレクションがインポートされているかどうかを確認できます。

Select Locations

You can select one or more locations in which the job runs. You can configure the job to test all of the locations every time or one location each time the job runs. For a complete list of Synthetic Agent locations, see Synthetic Agent Locations.

Use the hosted agents to monitor public API endpoints. You can use hosted agents to monitor the API jobs from locations where the real API traffic or request is generated.

Use the private agents to monitor the private APIs. For example, APIs used within a customer network.

Note:
  • The Hosted Agent Locations are where Splunk AppDynamics hosts public synthetic agents. Splunk AppDynamics has hosted agents in 17 locations (AWS locations only). You can execute the API monitoring jobs from these 17 hosted agent locations.

  • If you have deployed an API Monitoring Private Synthetic Agent, you can choose from Hosted Agent Locations or Private Agent Locations.
  • The Private Agent Locations are where you host your private synthetic agents. You can set up private synthetic agents in any of these environments.

Set a Schedule

Warning: The multiple schedules feature is supported only in SaaS Controllers 22.2.0 and later versions.

You can define the job schedule when you create or edit your job.

You can create multiple schedules for the same job. Each schedule can have its own time zone, frequency, and execution interval. This allows you to execute the job in different frequencies:

FrequencyExample
Different intervals in a day

Schedule 1: Execute the job in 1-minute frequency from 8 AM to 8 PM

Schedule 2: Execute the job in 5-minute frequency from 8:01 PM to 7.59 AM

Different days of the week

Schedule 1: Execute the job in 1-minute frequency on weekdays

Schedule 2: Execute the job in 5-minute frequency on weekends

Different time zones

Schedule 1: Execute the job in 1-minute frequency from 8 AM to 8 PM in the PST time zone

Schedule 2: Execute the job in 5-minute frequency from 8 AM to 8 PM in the BST time zone

Different date interval

Schedule 1: Execute the job in 1-minute frequency from February 21, 2022, to March 31, 2022

Schedule 2: Execute the job in 5-minute frequency from April 1, 2022, to March 31, 2026

Important: You can create a maximum of three schedules per job.

Click Add Schedule to configure another schedule for the same job. You must create at least one schedule.

Note:

You can prevent the execution of jobs during the maintenance period.

Let us assume you have a four-hour maintenance period on March 21, 2022 (1:01 AM - 5:00 AM). Then, you can configure multiple schedules as follows:

  • Schedule 1: Execute the job in 1-minute frequency from 8:00 AM on February 21, 2022, to 1:00 AM on March 21, 2022
  • Schedule 2: Execute the job in 1-minute frequency from 5:01 AM on February 21, 2022, to 12:00 AM on March 21, 2026

Set Timeout Period

You can configure timeout to make the jobs fail if the time taken to execute the jobs exceeds a certain duration. By default, the API jobs timeout if the job execution does not complete within 5 minutes.

Note: A job that fails because of timeout is considered an availability issue.

Configure Performance Thresholds

This is an optional step. You can configure performance thresholds that will trigger warning or critical synthetic events when the thresholds are exceeded.

Availability Configuration

API jobs failure irrespective of the reason, namely, invalid status code, response content validation, response size validation, and so on, are configured to be reported as an availability event by default. To avoid false positives, you can configure to re-test the jobs a specific number of times before triggering the events.

Performance Events

You can configure API jobs to trigger warning or critical error events based on the response time of the API jobs. To avoid false positives, you can configure to re-test the jobs a specific number of times before triggering the events.

Note: For storing credentials in the Synthetic Credential Vault, see

Credential Vault for Web Monitoring

.