New Relic


Learn how to use New Relic to automatically keep status of your Golive environments up to date


Integrate Golive with New Relic Synthetic Monitoring


New Relic Synthetic Monitoring allows to easily check availability of your applications.
Learn more: https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/getting-started/get-started-synthetic-monitoring/

:question_mark:

If you do not have an existing New Relic account, you can easily create a free account to perform this tutorial: https://newrelic.com/signup


In this section, you will learn how to configure New Relic in order to automatically update the status of Golive environments when an incident is detected or resolved on New Relic applications.

Ensure to have installed version 9.6.4 (or higher) of Golive


Connect New Relic with Golive API

New Relic will be the master system in charge to notify Golive when an environment is up or down. In order to do that, we must setup a connection between New Relic and the Golive Rest API. This connection will be used to update status of the Golive environments that are monitored by New Relic.

Step 1 Create a new Webhook destination

Go to “Alerts & AI” section and select “Destinations” sub-menu:

Screen Shot 2023-01-04 at 01.21.39.png

Click on “Webhook” to start configuring a new destination to interact with Golive

Step 2 Setup the Golive endpoint

  • choose an explicit name for the destination, for example: “{{jira.your-company.com}} - status-changes“

  • set this url as endpoint:

    https://{{jira.your-company.com}}/rest/apwide/tem/1.1/status-changes
    

    N.B. replace “{{jira.your-company.com}}” by the base url of the Jira instance where Golive is installed

  • activate “Use authorization” toggle

  • choose “Basic authorization”

  • enter the user/password of the technical user to connect to Jira and Golive API

Screen Shot 2023-01-04 at 00.52.42.png

Step 3 Save the destination

Do not forget to save your settings by clicking “Save destination”

Screen Shot 2023-01-04 at 01.28.28.png

This destination can now be used by different New Relic alerts


Configure Golive Notifications

Step 1 Create a new Alert Policy

Go to “Alerts & AI” section and create a new “alert policy”:

Screen Shot 2023-01-04 at 00.32.38.png

Choose a name and click “Set up notifications”

Screen Shot 2023-01-04 at 00.34.35.png

Click on Webhook:

Screen Shot 2023-01-04 at 00.35.53.png

step 2 Configure the Webhook Notification

Select the “Destination” that you have just created:

Screen Shot 2023-01-04 at 01.41.28.png

Replace the default value of the “Template” field by the following code snippet:

JSON
{
  "scope": {
    "criteria": [
      {
        "name": "environmentId",
        "values": {{json accumulations.tag.apwEnvId}}
      }
    ]
  },
  "status": {
    "name": "{{#if (eq state "CLOSED")}}Up{{/if}}{{#if (eq state "ACTIVATED")}}Down{{/if}}"
  }
}

Ensure that these 2 environment statuses exist in Golive:

  • “Up”

  • “Down”

Or replace “Up” and “Down” in the code snippet by your custom statuses.

You should get something like that:

Screen Shot 2023-01-04 at 01.43.57.png

If you have not configured and tagged the synthetic monitoring, the preview won’t correctly substitute the placeholder {{json accumulations.tag.apwEnvId}}, replacing it instead with N/A.

To test the connection, replace the placeholder with a hard-coded, valid environment ID set as a JSON array, as shown in the preview.

step 3 Test the Webhook Notification

In “Preview” tab, ensure that the environment id is correct on line 6, in field “values”.

If it is correct, click on “Send test notification” in order to check that everything is ok.

You can view error or success response by pointing your mouse over the text summary:

Screen Shot 2023-01-04 at 01.51.47.png

Configure a monitor per Environment

Step 1 Create a new Golive Environment and get its ID

Connect to Golive and create a new Golive environment that you will use to test this integration.

:info:

Learn how to create a new environment here: Clone and Delete Environments

Memorize the id of the environment that you want to use to test this integration.

In current example, the id of this environment is 28.

Step 2 Create a new Monitor

Connect to New Relic and start to create a new Monitor in “Synthetic monitoring” section and choose the “Availability” monitor:

Screen Shot 2023-01-03 at 23.52.37.png

Step 3 Tag your new Monitor with id of the corresponding Golive Environment

You must add a tag called “apwEnvId” containing the id of the Golive environment that is monitored
Ex: apwEnvId:28 (without space, where 28 should be replaced by your own Golive environment id):

NewRelicTagNewMonitorWithGoliveEnvironmentId.png

Important

Add tag with accurate value at this step, while creating the monitor. Tags updated or created after the creation of the monitor will not be transmitted to alerts and webhook notifications! (bug in New Relic at the time we write this documentation).

Step 4 Select locations and save the monitor

Screen Shot 2023-01-04 at 00.21.07.png

Step 5 Add the monitor to the Golive alert policy

The monitor must be added to the Golive alert policy previously created in order to alert Golive when an issue is detected or resolved.

Click on the Golive alert policy:

Screen Shot 2023-01-04 at 02.33.42.png

Click on “Create a condition”:

Screen Shot 2023-01-04 at 02.34.57.png

Click on “Synthetics”, “Single failure” and “Next, select entities”:

Screen Shot 2023-01-04 at 02.37.44.png

Select the monitor that you have just created and click on “Next, define thresholds”:

Screen Shot 2023-01-04 at 02.38.14.png

Choose a name for this condition (you can re-use the name of the monitor) and click on “Create condition”:

Screen Shot 2023-01-04 at 02.39.37.png
👍

You have configured your first Monitor connected with Golive!

You can repeat these steps to create a monitor for each of your Golive Environments.


Test your Monitors

Select “Monitor settings” in menu of the monitor your want to test:

Screen Shot 2023-01-04 at 02.22.00.png

Replace the right URL by a fake one:

Screen Shot 2023-01-04 at 02.23.05.png

Ensure that the period is set to 1 minute to reduce testing time

Wait 1 minute and open the “Notifications Log”:

Screen Shot 2023-01-04 at 02.45.19.png

You can check the status of the notifications that was sent to Golive in the table.

If the message was successfully sent, check that the status of your environment has been changed in Golive.

Put back the right URL and the right period:

Screen Shot 2023-01-04 at 02.48.16.png

After a while, re-open the “Notifications Log” to check that messages are properly sent to Golive and that the status of your environments have been updated accordingly in Golive.