Synthetic Monitoring browser timeout

Hi, Elastic staffs.

I'm testing Synthetic monitoring tool to check my company's website uptime and performance.
I'm using your code, config and image that you support on github.

I have a question about monitoring cofiguration in heartbeat.docker.yml file.
The website that I want to check takes about 2~3s, so I set the timeout config to 1s in heartbeat monitors in the yaml file like below.

- type: browser
  id: my-monitor
  name: My Monitor
  schedule: "@every 1m"
  script: |-
    step("load homepage", async () => {
        await page.goto('https://elastic.com');
    });
  **timeout: 1s**

I expected that the status of the website mornitoring got fail, but it got suceess nevertheless the duration time is over the timeout that I set 1sec.

How can I set the timeout configuration of browser monitoring in Synthetic.

Thank you in advance.

Hi @shinmaeng, the timeout parameter is only used by the ping type of monitors, not for synthetics.

You can set the timeout for your page load as a parameter to the goto method, for example:

await page.goto('https://elastic.com', { timeout:1000 });

This sets the timeout in milliseconds.

We do have an open issue to make this an option at the UJ/step level too, which will add more flexibility in the future: Configurable timeouts (UJ and Step Level) · Issue #133 · elastic/synthetics · GitHub

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.