Multi-Level Monitoring with Synthetic Monitoring

Hello Elastic,

I would like to ask, can Synthetic Monitoring features in Elastic did a multi-level monitoring?

In my situation, if the monitor is down for more than 5 times, the application will automatically restart or self-healing.

Screenshot 2023-03-15 at 3.38.42 PM

However, the error part, is not coming from the application itself, its coming from the Identity Service Authentication error which other application stack on it.

The application is doing well, how do I monitor this on multi level by alert it not to restart as its coming from other application integrated with it.

Can Elastic do the multi-level monitoring?

Thank you.

Hi @aisyaharifin,

If by multi-level, you mean configure alerts to be triggered based on multiple conditions being met, I'm afraid that's no possible at the moment.

But since you're using synthetics scripts, programmatically handling errors is possible , which would let you decide what you consider a "down" monitor on your side. Here's an example on how to handle a navigation error:

step('Check navigation error', async () => {

    try{
      await page.goto('https://<test page domain>');
    }catch(e){
        // Handle error logic here
       // Or throw to fail
       throw e;
    }

  });

That's the general approach, you'll need to implement the error handling logic tailored to your use case.

Hope that helps!

Hi @emilioalvap,

Thank you for your reply, this is really helpful, hopefully this could be done.

But can I know how do I apply the handle error logic?

Is there any documentation about this?

Thank you for your assistance.

Hi @aisyaharifin,

Determining what is considered a failure and how to handle errors will depend solely on your use case, I can't really provide you the logic since I'm not familiar with your setup. If you have a fronting service that is failing, you might be able to issue a different request to check its status, ymwv.

A synthetic script is basically arbitrary code, so you can run multiple requests or queries in a single script and combine them freely with error-handling logic.

I'd suggest looking into Elastic Synthetics docs and checking out Playwright syntax, which powers our synthetic agent, to get a feel of what's possible to code into a script.

Hi @emilioalvap ,

Thank you for the reference.

Do you have more example script on handle the navigation error?

If possible the one with use case similar to mine, basically its on the Identity Service error.

I just want to get more ideas on how I can apply the error logic inside my script.

Thank you.

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