All Projects → ocadotechnology → newrelic-alerts-configurator

ocadotechnology / newrelic-alerts-configurator

Licence: Apache-2.0 license
NewRelic alerts configurator

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to newrelic-alerts-configurator

php-newrelic
PHP Library for New Relic Agent
Stars: ✭ 14 (-64.1%)
Mutual labels:  newrelic
micrometer-registry-newrelic
Micrometer registry implementation that sends data to New Relic as dimensional metrics.
Stars: ✭ 27 (-30.77%)
Mutual labels:  newrelic
k8s-metadata-injection
Kubernetes metadata injection for New Relic APM to make a linkage between APM and Infrastructure data.
Stars: ✭ 19 (-51.28%)
Mutual labels:  newrelic
lumen-newrelic
New Relic instrumentation for the Lumen framework
Stars: ✭ 26 (-33.33%)
Mutual labels:  newrelic
newrelic-istio-adapter
An Istio Mixer adapter to send telemetry data to New Relic.
Stars: ✭ 15 (-61.54%)
Mutual labels:  newrelic
nrql-simple
nrql-simple provides a convenient way to interact with the New Relic Insights query API.
Stars: ✭ 13 (-66.67%)
Mutual labels:  newrelic
k8s-webhook-cert-manager
Generate certificate suitable for use with any Kubernetes Mutating Webhook.
Stars: ✭ 59 (+51.28%)
Mutual labels:  newrelic
nr1-status-pages
NR1 Status Pages allows you to collect and display the statuses of key dependencies in one place.
Stars: ✭ 31 (-20.51%)
Mutual labels:  newrelic
apollo-newrelic-extension
Apollo Server extension library for performing NewRelic transaction traces of graphql requests
Stars: ✭ 16 (-58.97%)
Mutual labels:  newrelic
nrjmx
Command line tool to connect to a JMX server and retrieve the MBeans it exposes.
Stars: ✭ 28 (-28.21%)
Mutual labels:  newrelic
Datav
📊https://datav.io is a modern APM, provide observability for your business, application and infrastructure. It's also a lightweight alternative to Grafana.
Stars: ✭ 2,757 (+6969.23%)
Mutual labels:  newrelic
statsbit
NewRelic drop-in replacement on top of Grafana and TimescaleDB
Stars: ✭ 19 (-51.28%)
Mutual labels:  newrelic
newrelic
💎 NewRelic PHP agent integration for Nette Framework (@nette)
Stars: ✭ 19 (-51.28%)
Mutual labels:  newrelic
php7-alpine
Docker container for PHP 7 in Alpine Linux, with almost all extensions that you may need
Stars: ✭ 20 (-48.72%)
Mutual labels:  newrelic
newrelic-quickstarts
New Relic One quickstarts help accelerate your New Relic journey by providing immediate value for your specific use cases.
Stars: ✭ 46 (+17.95%)
Mutual labels:  newrelic
newrelic-telemetry-sdk-python
A python library to send data to New Relic!
Stars: ✭ 23 (-41.03%)
Mutual labels:  newrelic
newrelic-context
Contains different helpers to make life easier with NewRelic and Context.
Stars: ✭ 21 (-46.15%)
Mutual labels:  newrelic
newrelic-cli
Newrelic client written in Python providing both CLI and Python interfaces
Stars: ✭ 26 (-33.33%)
Mutual labels:  newrelic
newrelic-telemetry-sdk-java
Java library for sending telemetry data to New Relic
Stars: ✭ 34 (-12.82%)
Mutual labels:  newrelic

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()
        .operatorTerm(OperatorTerm.ABOVE)
        .thresholdTerm(90f)
        .durationTerm(DurationTerm.DURATION_5)
        .timeFunctionTerm(TimeFunctionTerm.ALL)
        .priorityTerm(PriorityTerm.CRITICAL)
        .build();

Condition cpuCondition = ServersMetricCondition.builder()
        .conditionName("CPU Usage")
        .enabled(true)
        .server("some-host")
        .metric(ServersMetricCondition.Metric.CPU_PERCENTAGE)
        .term(above90Percent)
        .build();

// Create email channel for notifications
Channel emailChannel = EmailChannel.builder()
        .channelName("Team email")
        .emailAddress("[email protected]")
        .build();

// Create policy
PolicyConfiguration policy = PolicyConfiguration.builder()
        .policyName("My application policy")
        .condition(cpuCondition)
        .channel(emailChannel)
        .build();

// Synchronize changes
Configurator configurator = new Configurator("MY_REST_API_KEY");
configurator.setPolicyConfigurations(Collections.singletonList(policy));
configurator.sync();

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 [email protected]

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!

Binaries

Library is available in Maven Central

<dependency>
    <groupId>com.ocadotechnology.newrelicalertsconfigurator</groupId>
    <artifactId>newrelic-alerts-configurator</artifactId>
    <version>4.2.0</version>
</dependency>

Features

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:

Testing

To run tests call:

./gradlew test

Build

To build call:

./gradlew clean build

Contributing

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

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].