Skip to content

7.3Create a browser monitor

In the dashboard#

  1. Select + new monitor in the top navigation.
  2. Choose the browser tab.
  3. In name, enter a name you will recognise in an alert, for example Login works.
  4. Set check interval. It starts at 60 seconds. Your plan's minimum still applies.
  5. Set timeout. This is the time the whole check may take. It starts at 10 seconds. Raise it for scripts with several steps (see 7.7).
  6. Choose the regions and the alert channels.
  7. In start url, enter the page where the task begins, for example https://app.example.com/login.
  8. Under steps, build your script (see 7.4). The form already has one empty goto step. Select + add step to add a row. A new row starts as click. Use the remove button on a row to delete it.
  9. Select create monitor →.

To check the page without a script, remove all the steps before you save.

If the browser tab shows a meter such as <used> of <limit> browser monitors used, your plan limits how many browser monitors you can have (see 7.12).

If the form shows an error#

The form numbers steps from 1, the same as the rows you see.

MessageWhat to do
A URL is requiredEnter a start URL.
Enter a full http:// or https:// URLEnter the whole address, including https://.
Must be an http:// or https:// URLUse an http:// or https:// address.
step 2: url requiredEnter a URL in that goto step.
step 3: selector requiredEnter a selector in that step (see 7.5).
step 4: expected text requiredEnter the text that assert_text should find.
Your plan checks at most every 300 secondsEnter a longer check interval.
This monitor is paused — resume it to run a checkResume the monitor, then select run once now again.
check just ran — try again in <N>sWait for the time shown, then try again.

Through the API#

Send a POST to CreateBrowserMonitor. A full example is in 7.6. These are the fields:

FieldWhat to enter
nameThe monitor's name.
startUrlRequired. An http:// or https:// address.
scriptJsonThe script, written as a JSON string, not as an array. Leave it out to check the page without a script.
intervalSecondsHow often to check. Your plan's minimum still applies.
timeoutMsThe time the whole check may take, in milliseconds (see 7.7).
locationsThe regions to check from (see 3.2).
alertChannelIdsThe alert channels to notify (see chapter 10).
assertionsOptional page checks. API only (see 7.4).

The answer is {"monitor": {...}}. In the saved monitor, the start URL and script are called browserStartUrl and browserScriptJson.

To change the script later, call UpdateMonitor with config. This replaces the whole setup, so send every field again. To run a check now through the API, use TriggerNow (see 3.6).

When you save through the API, obsrvly checks only the outline of the script. It refuses these:

  • start_url required, or start_url must be an http or https URL.
  • script_json must be a JSON array of steps.
  • script_json: step 0 is not an object.
  • script_json: step 0: kind must be one of goto, click, fill, wait_for, assert_visible, assert_text.
  • A script larger than 256 KiB, or a monitor larger than 900 KiB in total.

Other mistakes, such as a missing selector, show up when the check runs (see 7.4).

Last updated