> For the complete documentation index, see [llms.txt](https://docs.statuspal.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.statuspal.io/platform/integrations/new-relic.md).

# New Relic

This guide outlines the steps to integrate StatusPal's monitoring service with New Relic's synthetic checks. This integration allows you to receive alerts in StatusPal via webhook

To automate the reporting and closing of incidents on your status page based on the status reported by New Relic synthetic checks, follow these steps.

### Create your Webhook Integration in StatusPal

First, you need to create an <mark style="color:purple;">endpoint URL</mark> within StatusPal. This URL will act as the bridge between New Relic and StatusPal, receiving notifications from New Relic about uptime check results via webhook.

* **Navigate to Services:** On your Status Page, create a new service or edit an existing service.
* **Add Webhook:** On *Monitoring and incident automation section*, check on `Webhook` and select `NewRelic`.
* **Finish and Save:** Create or update the service, then copy the <mark style="color:purple;">endpoint URL</mark> that will be created for you.

<figure><img src="https://4061983002-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIMm5p2V7PNx3dS7vwKE%2Fuploads%2Fh0MsiGsOOyVurDBtX21u%2Fnew-relic-configuration-in-statuspal.png?alt=media&amp;token=65bebfa8-9fe1-41a0-a469-8608767f887a" alt=""><figcaption></figcaption></figure>

### Create your Webhook Integration in New Relic

Next, you need to create a ***webhook*** and ***workflow*** within New Relic.

* **Navigate to Alerts:** On the New Relic navigation bar, click on `Alerts`.
* **Add a Destination:** On the Alerts' navigation bar, click on `Destinations` and them on `Webhook`.
* **Add Webhook:** In the new webhook configuration, you'll need to add the <mark style="color:purple;">endpoint URL</mark> provided by StatusPal. *This URL is specific to your StatusPal service configuration and is essential for the integration to work correctly*. Paste this URL into the appropriate field.
* **Create a Workflow:** On the Alert's navigation bar, click on `Workflows` and then click on `Add a workflow`.
* **Configure Workflow:** On the configuration of the workflow, on the *Filter data section*, select on *Priority* the option **CRITICAL**. *<mark style="color:yellow;">Please note that if you have more than one ping monitor, you need to set a tag in order to link it to the workflow.</mark>* Then on the *Add a channel section* click on `Webhook` to open the *notification message*. Furthermore on *Destination option*, select the *webhook* you created for StatusPal.
* **Payload configuration:** On the notification message, you can configure the payload that will be send to StatusPal. <mark style="color:green;">**We strongly suggest that you keep the default template**</mark>. However, if you prefer to configure it because you will use this *workflow* somewhere else, you must keep 2 properties on the json object:

```
{
  "priority": {{ json priority }},
  "state": {{ jason state }},
  Rest or your properties...
}
```

<figure><img src="https://4061983002-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIMm5p2V7PNx3dS7vwKE%2Fuploads%2Fpg366cCkSBF3ZDmF0lnB%2Fnew-relic-payload-configuration.png?alt=media&amp;token=3eba6e12-102b-488a-9ad9-2d96fca6445b" alt=""><figcaption></figcaption></figure>

### Create your Synthetic Monitor in New Relic

Next, you need to configure your synthetic monitor in New Relic and link it to the webhook you just created.

* **Navigate to Synthetics:** On the New Relic navigation bar, click on `Synthetic Monitoring`.
* **Create Monitor:** Click on `Create monitor` and create a new monitor for the synthetic you want to track using the **`Availability`**` `` ``- Ping ` template. Configure the monitor according to your needs (e.g., check frequency, target URL). *<mark style="color:yellow;">Please note that if you have more than one ping monitor, you need to set a tag in order to link it to the workflow.</mark>*

That's it! Once you have completed these steps, New Relic will send notifications about your uptime checks to StatusPal, allowing you to monitor and manage your service availability from a centralized platform.

## Metrics from New Relic

In addition to incident automation, you can pull uptime metrics from a New Relic Synthetic Monitor directly into your status page charts.

1. Go to your [New Relic API keys page](https://one.eu.newrelic.com/api-keys) and create a new **User** API key.
2. Copy your **Account ID** and the new **API key**.
3. In your Statuspal admin, go to your status page's **Dashboard > Integrations > New Integration** and select **New Relic**.
4. Enter your Account ID and API key, select the correct region, and click **Create**.
5. Go to **Metrics > New Metric** and select your New Relic integration as the **Source**.
6. Select the synthetic monitor to pull data from and configure the metric type and unit. Click **Create**.

{% hint style="info" %}
Once created, the metric will backfill data from the last hour and continue populating going forward.
{% endhint %}
