Skip to content

Every 5 minutes

Hear when a synthetic monitor starts failing

When one of your New Relic synthetic checks fails, you get one Slack message per monitor until it passes again.

Runs
Every 5 minutes
Apps
New Relic
AI
Not needed
Access
user key (read)

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes check my New Relic synthetic monitors and post to #status in Slack when any monitor has a failed check, naming the monitor and location.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Synthetic monitors in New Relic visit your login page, run a scripted checkout or ping an API from several locations. They are only valuable if someone notices when they fail. Often the failure sits in New Relic as a red check while the team is busy, and the first they hear is a customer saying the site has been down for an hour. Alert policies exist, but many teams never route them to a channel people read.

Every five minutes ClickRuntime runs an NRQL query on SyntheticCheck for failed results since its last run, and posts to Slack once for each monitor that starts failing, naming the monitor and location. When that monitor passes again, the state resets so the next failure is announced.

Teams that rely on a handful of key user journeys, such as signup and payment, tend to use it.

What you get out of it

  • Outages are noticed before customers write in

    A failing login monitor appears in Slack within five minutes of the failed run. Engineers begin investigating while support is still unaware there is a problem. Engineers begin investigating while support is still unaware that anything is wrong.

  • One message per failing monitor

    Alerting once per monitor prevents a stream of identical posts while the page is down. The channel remains readable, and the thread can be used to coordinate the fix. Alerting once per monitor prevents a stream of identical posts while the page is down, and the thread becomes the place to coordinate.

  • Location detail helps diagnosis

    A failure from only one region suggests a CDN or DNS problem, while a failure from every location suggests your application. Knowing which narrows the search before anyone opens a dashboard.

  • Key journeys are protected

    A scripted browser monitor catches breakages that plain uptime pings miss, such as a payment form that loads but cannot submit. Alerting on those protects the paths that earn revenue.

  • Recovery closes the loop

    When a monitor passes again, the state resets and the next failure produces a new alert. The incident has a visible start and end, which is useful when writing up what happened.

How it works

What happens, step by step

  1. Every five minutes, ClickRuntime asks New Relic for synthetic check results that failed since the last check.

  2. It groups the failures by monitor and location, and counts how many times each failed.

  3. Monitors that are newly failing are posted to #status, for example "Acme login flow failed in Frankfurt, DE (2x)".

  4. A monitor isn't mentioned again until it has passed and then failed once more.

Before it runs live

  • Connect New Relic

What you get

RunsEvery 5 minutes
Hear when a synthetic monitor starts failingtoday, 9:00Succeeded
Slack · #statusSynthetic checks failing: Acme login flow failed in Frankfurt, DE (2x)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other New Relic steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
get_alerted_on_failing_synthetic_checks.pyexample
from clickruntime import on_trigger, credentials, http, notify

ACCOUNT_ID = 1234567
NRQL = ("SELECT count(*) FROM SyntheticCheck WHERE result = 'FAILED' "
        "FACET monitorName, locationLabel SINCE 5 minutes ago")

@on_trigger
def run(event):
    query = '{ actor { account(id: %d) { nrql(query: "%s") { results } } } }' % (ACCOUNT_ID, NRQL)
    resp = http.post("https://api.newrelic.com/graphql", json={"query": query},
                     headers={"API-Key": credentials.secret("NEW_RELIC_USER_KEY")})
    resp.raise_for_status()
    failures = resp.json()["data"]["actor"]["account"]["nrql"]["results"]
    if not failures:
        return {"failed": 0}
    lines = [f"{f['facet'][0]} failed in {f['facet'][1]} ({f['count']}x)" for f in failures]
    notify.slack("Synthetic checks failing:\n" + "\n".join(lines), channel="#status")
    return {"failed": len(failures)}

FAQ

Common questions

Which kinds of monitors does it cover?
Any monitor that writes to the SyntheticCheck event type in New Relic, including ping, simple browser, scripted browser and API test monitors. Select monitors by name or alert on all of them. Monitors that run from several locations report each location separately.
Does it alert on a single failed run?
By default a failed result since the last run triggers an alert, but you can require two failures in a row to avoid noise from network blips. Tell your AI assistant how strict you want it to be.
How does it avoid repeating an alert?
It remembers which monitors are currently failing in saved state and only alerts when a monitor changes from passing to failing. Once the monitor passes again, it is cleared and can alert next time. This is what keeps a long outage to a single post.
What permissions does it need?
user key (read). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (every 5 minutes). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Hear when a synthetic monitor starts failing” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.