Skip to content
NewRelic alerts configurator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Added kotlin DSL for alerts configurator Apr 6, 2019
newrelic-alerts-configurator Added readme Apr 9, 2019
newrelic-api-client Custom deserializer for incude_json_attachment field from AlertsChann… Feb 4, 2019
.gitignore Removed e-mail address from code of conduct Aug 28, 2017 Changed name of the project to 'newrelic-alerts-configurator' Aug 28, 2017
LICENSE Initial commit Aug 28, 2017 Released 3.4.0 Jun 6, 2019
gradlew Permissions changed Nov 3, 2016
lombok.config use @slf4j in synchronizers Nov 18, 2016
settings.gradle Added kotlin DSL for alerts configurator Apr 6, 2019

NewRelic Alerts Configurator

NewRelic Alerts Configurator can be used to configure NewRelic alerts for your application. Instead of defining alerts through UI you can define them in code. It allows you to automatize alerts configuration, easily recover them in case of wipe out and have full history of changes in your version control system.

How to use NewRelic Alerts Configurator

First step is to obtain API key for given NewRelic account. Then You can create configuration. For example:

// Create alert condition
TermsConfiguration above90Percent = TermsConfiguration.builder()

Condition cpuCondition = ServersMetricCondition.builder()
        .conditionName("CPU Usage")

// Create email channel for notifications
Channel emailChannel = EmailChannel.builder()
        .channelName("Team email")

// Create policy
PolicyConfiguration policy = PolicyConfiguration.builder()
        .policyName("My application policy")

// Synchronize changes
Configurator configurator = new Configurator("MY_REST_API_KEY");

That's all!

This code creates alert policy that will raise critical alert whenever some-host's cpu usage will raise above 90% in last 5 minutes. Information about alert will be emailed to

More examples can be found in newrelic-alerts-configurator-examples module.

How to obtain New Relic REST API key

In above example we used MY_REST_API_KEY. Details on how to obtain it can be found in NewRelic's REST API docs

Note that for some configurations you will need Admin User's New Relic API key!


Library is available in Maven Central



Detailed list of supported features can be found in newrelic-alerts-configurator module.

NewRelic API Client

This project contains following library useful for developers that monitor their application using New Relic:


To run tests call:

./gradlew test


To build call:

./gradlew clean build


We encourage you to contribute to NewRelic Alerts Configurator. Please check out the Contributing guide for guidelines about how to proceed.


This product is licensed under Apache License 2.0. For details see license file

You can’t perform that action at this time.