Monitoring the dynamic elements in synthetic

Can we monitor the DOM element of the page and put the alert on the dynamic status of the different jobs

Hi @Sachin_Chourasiya,

It would be useful to have more information on what you're trying to pick up from the page. Do you mean you want to check a particular state or attribute of a DOM element on the page and then trigger an alert based on the value? Are you using browser-based monitors using Playwright at all?

Thanks for response,
I have attached the image of the page that we want to monitor
we want to trigger the alert if any job's state is "failed"

Hi Carly,

We want to set alert around the dynamic status of jobs

Thanks @Sachin_Chourasiya and @Anjali3 for the additional detail. I think you could use a scripted monitor for this, with steps similar to the following:

  1. Create a journey and use a Playwright locator to pull the status value and anything else from the DOM.
  2. Throw an exception for any failures to trigger a failure in the monitor.
  3. Setup an alert to trigger on failure of the monitor.

I hope that makes sense.

Thanks @carly.richmond for your valuable response.
So as far as I can understand from your response you mean to say that we have to pull the status value of every job, but this seems difficult because the jobs can increase or decrease.

It's difficult to say without seeing the underlying HTML source. But it is possible to pull multiple elements using the Playwright all selector.

It looks like the all selector was introduced in v1.29, and I see the latest version of Elastic Synthetics uses v1.45. So it should be doable.