X-RAMP
BlogCleaning up disabled alert conditions without clicking through every account

Cleaning up disabled alert conditions without clicking through every account

Published by X-RAMP ·

Every New Relic estate I have worked with has the same quiet problem: disabled alert conditions. Someone turns a condition off during an incident because it is too noisy. Someone else disables one while a service is being migrated. A team changes hands, and nobody remembers why half of their conditions are switched off. Months later they are still there, cluttering policies, confusing anyone trying to understand what is actually being watched, and hiding the few that were switched off by mistake and should be back on.

There are two shapes this takes, and I run into both.

Lots of accounts, no idea how many. You manage dozens or hundreds of accounts. You suspect there are disabled conditions scattered across them, but you have no list. Opening each account, each policy, each condition is not a job anyone finishes.

One account, a pile of them. You own a single account that has grown over the years, and the alerting section is a graveyard. You know you want to clean it up. You just do not want to do it one condition at a time in the UI.

I wanted a simple way to deal with both, so I built a small tool. It is one folder you download, unzip and start on your own computer. There is nothing to install beyond Node, and nothing is sent anywhere except to New Relic.

What it does

You give it a New Relic user API key. It lists the accounts that key can see. Choose one account, or choose All accounts and it walks through every account the key can read and builds one list.

Each row shows the account, the policy, the condition and whether it is enabled or disabled. A single checkbox hides everything that is enabled, so what is left is exactly the set you want to review. From there, each row has three buttons:

  • Enable, for a disabled condition that should never have been turned off.
  • View in New Relic, which opens that condition in a new tab so you can see what it does before deciding.
  • Delete, for the ones that are just clutter.

There is also a search box and the columns sort, which helps when the list is long. If the key cannot read one of the accounts, the tool skips it, tells you which one, and keeps going.

Downloading and running it

  1. Download the zip: nr-condition-manager.zip (11 KB). It is also on the Downloads page.
  2. Unzip it anywhere on your computer.
  3. Make sure you have Node 18 or newer. It is free from nodejs.org, and it is the only thing to install.
  4. Start it:
    • Mac: double-click start.command. If macOS blocks it, right-click the file and choose Open.
    • Windows: double-click start.bat.
    • Linux: run ./start.sh.
  5. Your browser opens the page. If it does not, go to http://127.0.0.1:4777/.

One thing to know: open the page the launcher gives you, not the index.html file on its own. The browser cannot talk to New Relic from a file, so the small program the launcher starts does that part for you. It listens only on your own computer, your key is kept only in the open page and never written to disk, and closing the window that started it stops everything.

Paste your user API key (it starts with NRAK-), choose US or EU, and click Load accounts.

Deleting is permanent

I want to be plain about this one. A condition you delete is gone. New Relic does not keep a recycle bin for alert conditions, and this tool cannot bring one back. Unless you have a backup of the condition, there is no recovering it.

So before you delete anything you are not completely sure about:

  • Use View in New Relic and look at the condition.
  • Make sure you have a backup of your alert conditions first. If you are not sure you do, stop and take one before cleaning up.
  • Start by enabling the ones that look like mistakes, and delete only the ones you have confirmed you do not need.

The tool asks you to confirm each delete, but that confirmation is the last stop, not a safety net.

The permissions you need

The tool acts as you. It uses your user API key, so it can only do what your user is allowed to do in each account.

  • To list conditions, your user needs to be able to view alert policies and conditions in the accounts you want to look at. A read-only style role that includes alerts is enough.
  • To enable or delete conditions, your user needs a role that can modify and delete alert conditions in that account.

If your key can read an account but not change it, the list will load and the Enable and Delete buttons will return an error for that account. If you only want to look, you do not need modify access at all. Many teams give people a read-level role for the survey and use someone with modify access to do the cleanup.

The key itself must be a user API key, not an ingest or license key.

What it does not cover

The tool lists NRQL conditions, which is what almost everything is today. Older infrastructure, APM, synthetic and external service conditions are not in the list.

Try it on a small account first

Load one account, turn on the disabled-only filter, and see what is in there. In my experience the first pass is a mix of obvious leftovers and a handful of conditions that quietly should have been on all along. Both are worth finding.

Part of the X-RAMP toolbox for New Relic administrators. More tools are on the Downloads page.