No results for ""
EXPAND ALL
  • Home
  • API docs

GIVE DOCS FEEDBACK

Using flag triggers with New Relic One

Read time: 3 minutes
Last edited: Sep 29, 2023
Flag triggers is an Enterprise feature

Flag triggers is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Overview

This topic explains how to use LaunchDarkly's trigger feature with New Relic One. For example, you can create a policy in New Relic One that uses a LaunchDarkly trigger to toggle a flag's targeting on or off if a performance metric drops below a certain threshold.

Prerequisites

In order to complete this topic, you must meet the following prerequisites:

  • You must have a feature flag with a trigger. To learn more about creating triggers, read Creating a new flag trigger.
  • You must have access to the trigger's URL, which you copied and saved during the trigger creation process. To learn more, read Understanding flag triggers' security.
  • You must have an existing New Relic One account.

Connecting a flag trigger to New Relic One

Connecting a LaunchDarkly trigger to New Relic One takes two steps.

You must:

  1. Create a webhook-type notification channel in New Relic One with your trigger URL, and
  2. Connect that webhook to a New Relic One policy.

Setting up a JSON template in New Relic One

First you must configure a JSON template to use the LaunchDarkly trigger.

To configure the template:

  1. Log in to New Relic One.
  2. Navigate to "Alerts & AI" and find the "Notification Channels" section in the sidebar.
  3. In the "Notification Channels" section, click + New Notification Channel.
  4. Select Webhook as the channel type.
  5. Paste the LaunchDarkly trigger URL into the "Base URL" field.
  6. Click Create Channel.

Connecting the webhook to a New Relic One policy

After you create the webhook notification channel in New Relic One, you must connect it to a policy in order for the LaunchDarkly trigger to perform actions on the flag.

  1. Under "Alerts & AI," navigate to "Policies."
  2. Select the policy you wish to connect to the trigger.
  3. On the policy's "Notification channels" tab, add your newly-created webhook channel.

Testing the trigger configuration

After you create a trigger in New Relic One, you can verify that it has connected to LaunchDarkly correctly.

To test the trigger:

  1. Navigate to the configuration for the webhook notification channel you set up in New Relic One.
  2. Click Send a test notification at the bottom of the page. A popup with a response code appears.
  3. Navigate back to the flag's Settings page in LaunchDarkly.
  4. Click on the overflow menu on your LaunchDarkly trigger to confirm that the execution count has incremented. Sending a test notification does not trigger the flag action, so don't worry that you might toggle a flag by testing the configuration.

When the conditions of your policy are met, your flag changes will now be performed.