06 Mar 2023 08:24 PM
I want to send out a notification only if the Synthetic monitor Type contains specific text or wording e.g., Type: 401 Unauthorized but not for e.g., Type: Wait timeout was too short for the page to load.
Example of additional context I get in the Slack message, in this case:
Synthetic monitor global outage
1 failure
Actions: click on "Log in"
Type: 401 Unauthorized
I've tried using the custom event filter but it doesn't seem to follow my logic 😂
Solved! Go to Solution.
07 Mar 2023 07:58 AM
Hi,
Maybe a content validation to fail when some plain text is found: Validate content
07 Mar 2023 08:39 AM
Anton's solution would be my first suggestion, to use the content validation available in the product. You can also add extra validation in a JavaScript event.
If neither of those options work for your scenario, you can push an event from the Browser monitor by sending a fetch request in a JavaScript event.
07 Mar 2023 08:48 AM
Thanks for the suggestions, @HannahM and @AntonPineiro - I'm already using content validation for plain text, to confirm if the user logged in successfully, but I don't want to be alerted on the Wait timeout types.
If the wait timeout occurs, it should not do anything in the form of alerting, other than run the check again on the next interval. I hope I'm making sense.
I'll look into the other suggestions later, hopefully, one of those will do the trick.
12 May 2023 12:55 PM
@andre_vdveen let us know when you'll find a solution 🙂
18 May 2023 02:03 PM - edited 18 May 2023 02:10 PM
I think I figured it out...based on my tests, the problem is raised but the Slack notification doesn't come through for the two error types (codes) that I've excluded. If I stop the web server, the problem is raised and the Slack message comes through, confirming that the Slack integration is working but only when the two errors are not seen.
I've done it via the Alerting profile, by adding the following:
The issue I faced before, was that I didn't use the full error code...I only used the text without the actual error code e.g., 1401 for the Wait timeout was too short for the page to load errors; once I figured out where to get the full error code text, on the details of the failed execution, I copied the full code ('circled' in blue) and pasted that into the value field for the Property filter.
18 May 2023 06:08 PM
@andre_vdveen thanks for sharing! 🙂