> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/ai-sre/ai-sre-for-administrators/set-up-alert-management/webhooks/integration-guides/monitoring/new-relic.md).

# New Relic Integration Guide

Configure New Relic Alerts to send webhook notifications to Harness AI SRE when issues are created or updated.

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **Harness webhook endpoint**: Create a New Relic webhook in Harness AI SRE using the [New Relic webhook template](/ai-sre/ai-sre-for-administrators/set-up-alert-management/webhooks/templates/monitoring/new-relic.md).
* **New Relic access**: Permissions to create workflows and notification destinations.
* **Webhook URL**: Copy the webhook URL from your Harness webhook configuration.
* **New Relic version**: This guide covers New Relic's Applied Intelligence workflows (current notification system).
* **Workflows documentation**: Go to [Applied Intelligence - Workflows](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/) to understand workflow configuration.
* **Webhook destination reference**: Go to [Notification Destinations](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/destinations/) for webhook setup details.

***

### Create webhook destination <a href="#create-webhook-destination" id="create-webhook-destination"></a>

#### Navigate to destinations <a href="#navigate-to-destinations" id="navigate-to-destinations"></a>

Open the destinations configuration in New Relic:

1. In New Relic, go to **Alerts & AI**, then select **Destinations**
2. Click **Create destination**

#### Configure webhook destination <a href="#configure-webhook-destination" id="configure-webhook-destination"></a>

{% tabs %}
{% tab title="Basic configuration" %}

* **Destination name**: `Harness AI SRE`
* **Destination type**: Select **Webhook**
* **Endpoint URL**: Your Harness webhook URL

  ```
  https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>
  ```
* **Authentication**: None (or Bearer token if required)
  {% endtab %}

{% tab title="With authentication" %}

* **Destination name**: `Harness AI SRE`
* **Destination type**: Select **Webhook**
* **Endpoint URL**: Your Harness webhook URL
* **Authentication**: Select **Bearer token**
* **Token**: `your-webhook-secret`

Or use **Custom headers**:

* **Header name**: `X-Webhook-Secret`
* **Header value**: `your-secret-key`
  {% endtab %}

{% tab title="Custom payload template" %}

* **Destination name**: `Harness AI SRE`
* **Destination type**: Select **Webhook**
* **Endpoint URL**: Your Harness webhook URL
* **Custom payload**: Enable
* **Payload template**:

```json
{
  "issue_id": "{{ issueId }}",
  "issue_title": "{{ issueTitle }}",
  "priority": "{{ priority }}",
  "state": "{{ state }}",
  "trigger_event": "{{ triggerEvent }}",
  "issue_url": "{{ issuePageUrl }}",
  "violation_chart_url": "{{ violationChartUrl }}",
  "created_at": "{{ createdAt }}",
  "updated_at": "{{ updatedAt }}",
  "account_id": "{{ nrAccountId }}",
  "account_name": "{{ nrAccountName }}",
  "entity_name": "{{ entitiesData.entities.[0].name }}",
  "entity_type": "{{ entitiesData.entities.[0].type }}",
  "condition_name": "{{ accumulations.conditionName.[0] }}",
  "policy_names": {{ json accumulations.policyName }},
  "labels": {{ json labelsObject }}
}
```

{% endtab %}
{% endtabs %}

#### Test destination <a href="#test-destination" id="test-destination"></a>

Click **Test connection** to verify the webhook is reachable.

#### Save destination <a href="#save-destination" id="save-destination"></a>

Click **Create destination** to save.

***

### Create notification channel <a href="#create-notification-channel" id="create-notification-channel"></a>

#### Navigate to channels <a href="#navigate-to-channels" id="navigate-to-channels"></a>

Open the channels configuration in New Relic:

1. Go to **Alerts & AI**, then select **Channels**
2. Click **Create channel**

#### Configure channel <a href="#configure-channel" id="configure-channel"></a>

Set the channel name, destination, and triggers:

* **Channel name**: `Harness AI SRE Channel`
* **Destination**: Select **Harness AI SRE** (the destination you just created)
* **Notification trigger**: Select events to send
  * Issue activated
  * Issue acknowledged
  * Issue priority changed
  * Issue closed

#### Save channel <a href="#save-channel" id="save-channel"></a>

Click **Create channel**.

***

### Create workflow <a href="#create-workflow" id="create-workflow"></a>

#### Navigate to workflows <a href="#navigate-to-workflows" id="navigate-to-workflows"></a>

Open the workflows configuration in New Relic:

1. Go to **Alerts & AI**, then select **Workflows**
2. Click **Add a workflow**

#### Configure workflow <a href="#configure-workflow" id="configure-workflow"></a>

{% tabs %}
{% tab title="Basic workflow" %}

* **Workflow name**: `Send to Harness AI SRE`
* **Filter data**: Configure filters (optional)
  * Filter by priority: `Critical` or `High`
  * Filter by entity type: `Application`, `Host`, etc.
* **Enrich data**: Add enrichments (optional)
* **Notify**: Select **Harness AI SRE Channel**
  {% endtab %}

{% tab title="Filtered by priority" %}

* **Workflow name**: `Critical Alerts to Harness`
* **Filter data**:
  * **Attribute**: `priority`
  * **Operator**: `is`
  * **Value**: `Critical`
* **Notify**: Select **Harness AI SRE Channel**
  {% endtab %}

{% tab title="With enrichments" %}

* **Workflow name**: `Enriched Alerts to Harness`
* **Filter data**: Configure filters
* **Enrich data**:
  * Add **NRQL query** to enrich with additional metrics
  * Add **Image** to include chart snapshots
* **Notify**: Select **Harness AI SRE Channel**
  {% endtab %}
  {% endtabs %}

#### Activate workflow <a href="#activate-workflow" id="activate-workflow"></a>

Toggle **Active** to enable the workflow.

#### Save workflow <a href="#save-workflow" id="save-workflow"></a>

Click **Save workflow**.

***

### Configure field mapping in Harness <a href="#configure-field-mapping-in-harness" id="configure-field-mapping-in-harness"></a>

In your Harness webhook configuration, map New Relic payload fields to alert properties.

#### New Relic webhook payload structure <a href="#new-relic-webhook-payload-structure" id="new-relic-webhook-payload-structure"></a>

```json
{
  "id": "issue-123",
  "issueId": "issue-123",
  "issueTitle": "High Error Rate on Application XYZ",
  "issuePageUrl": "https://one.newrelic.com/issues/issue-123",
  "priority": "CRITICAL",
  "state": "ACTIVATED",
  "triggerEvent": "STATE_CHANGE",
  "createdAt": 1625097600000,
  "updatedAt": 1625097600000,
  "violationChartUrl": "https://chart.googleapis.com/chart?...",
  "nrAccountId": 12345,
  "nrAccountName": "My Company",
  "entitiesData": {
    "entities": [
      {
        "id": "entity-456",
        "name": "Application XYZ",
        "type": "APPLICATION"
      }
    ]
  },
  "accumulations": {
    "conditionName": ["Error rate > 5%"],
    "policyName": ["Production Alerts"],
    "tag.environment": ["production"],
    "tag.team": ["platform"]
  },
  "labelsObject": {
    "environment": "production",
    "team": "platform"
  }
}
```

#### Map basic fields <a href="#map-basic-fields" id="map-basic-fields"></a>

Use Mustache templates:

```yaml
title: "{{webhook.issueTitle}}"
message: |
  New Relic Issue: {{webhook.issueTitle}}
  
  State: {{webhook.state}}
  Priority: {{webhook.priority}}
  Entity: {{webhook.entitiesData.entities[0].name}}
  
  View issue: {{webhook.issuePageUrl}}
severity: "{{webhook.priority}}"
source: "new-relic"
link: "{{webhook.issuePageUrl}}"
tags:
  - "issue_id:{{webhook.issueId}}"
  - "entity:{{webhook.entitiesData.entities[0].name}}"
  - "entity_type:{{webhook.entitiesData.entities[0].type}}"
  - "state:{{webhook.state}}"
```

#### Advanced field mapping with CEL <a href="#advanced-field-mapping-with-cel" id="advanced-field-mapping-with-cel"></a>

```cel
// Extract issue details
title: webhook.issueTitle
message: "New Relic Issue: " + webhook.issueTitle + "\n\n" +
         "State: " + webhook.state + "\n" +
         "Priority: " + webhook.priority + "\n" +
         "Entity: " + (has(webhook.entitiesData.entities) && size(webhook.entitiesData.entities) > 0 
           ? webhook.entitiesData.entities[0].name 
           : "Unknown") + "\n\n" +
         "Violation Chart: " + webhook.violationChartUrl + "\n" +
         "Issue URL: " + webhook.issuePageUrl

// Map New Relic priority to Harness severity
severity: webhook.priority == "CRITICAL" ? "critical" :
          webhook.priority == "HIGH" ? "high" :
          webhook.priority == "MEDIUM" ? "medium" : "low"

source: "new-relic"
link: webhook.issuePageUrl

// Extract all labels as tags
tags: has(webhook.labelsObject) 
  ? webhook.labelsObject.keys().map(k, k + ":" + string(webhook.labelsObject[k]))
  : ["issue_id:" + webhook.issueId]

// Filter: only activated and updated issues
filter: webhook.state in ["ACTIVATED", "CREATED"] || 
        (webhook.state == "UPDATED" && webhook.priority in ["CRITICAL", "HIGH"])

custom_fields: {
  "issue_id": webhook.issueId,
  "entity_id": has(webhook.entitiesData.entities) && size(webhook.entitiesData.entities) > 0
    ? webhook.entitiesData.entities[0].id
    : "",
  "account_id": string(webhook.nrAccountId),
  "violation_chart_url": webhook.violationChartUrl
}
```

***

### Test the integration <a href="#test-the-integration" id="test-the-integration"></a>

#### Create test alert condition <a href="#create-test-alert-condition" id="create-test-alert-condition"></a>

Create a condition that fires immediately to confirm delivery:

1. Go to **Alerts & AI**, then select **Alert policies**
2. Create a test policy and condition that will fire immediately
3. Assign the workflow to the policy

#### Trigger the condition <a href="#trigger-the-condition" id="trigger-the-condition"></a>

Wait for the condition to evaluate and create an issue.

#### Verify in New Relic <a href="#verify-in-new-relic" id="verify-in-new-relic"></a>

Confirm the issue was created and the notification was sent:

1. Go to **Alerts & AI**, then select **Issues & Activity**
2. Verify the issue was created
3. Check **Workflows** to see notification sent

#### Verify in Harness <a href="#verify-in-harness" id="verify-in-harness"></a>

Confirm the issue arrived and mapped correctly:

1. Navigate to **Alerts** in Harness AI SRE
2. Check that the issue appears
3. Verify field mapping is correct

***

### Available New Relic fields <a href="#available-new-relic-fields" id="available-new-relic-fields"></a>

| Field                         | Description                | Example                                          |
| ----------------------------- | -------------------------- | ------------------------------------------------ |
| `id`                          | Issue ID                   | `issue-123`                                      |
| `issueId`                     | Issue ID (same as id)      | `issue-123`                                      |
| `issueTitle`                  | Issue title                | `High Error Rate on Application XYZ`             |
| `issuePageUrl`                | Link to issue              | `https://one.newrelic.com/issues/...`            |
| `priority`                    | Issue priority             | `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`              |
| `state`                       | Issue state                | `ACTIVATED`, `ACKNOWLEDGED`, `CLOSED`, `UPDATED` |
| `triggerEvent`                | Event type                 | `STATE_CHANGE`, `PRIORITY_CHANGED`               |
| `createdAt`                   | Creation timestamp (ms)    | `1625097600000`                                  |
| `updatedAt`                   | Last update timestamp (ms) | `1625097600000`                                  |
| `violationChartUrl`           | Chart image URL            | `https://chart.googleapis.com/...`               |
| `nrAccountId`                 | New Relic account ID       | `12345`                                          |
| `nrAccountName`               | Account name               | `My Company`                                     |
| `entitiesData.entities`       | Affected entities array    | `[{id, name, type}]`                             |
| `accumulations.conditionName` | Condition names            | `["Error rate > 5%"]`                            |
| `accumulations.policyName`    | Policy names               | `["Production Alerts"]`                          |
| `labelsObject`                | Key-value labels           | `{"environment": "production"}`                  |

***

### Advanced configuration <a href="#advanced-configuration" id="advanced-configuration"></a>

#### Filter by priority <a href="#filter-by-priority" id="filter-by-priority"></a>

Create separate workflows for different priorities:

**Critical issues**:

* **Filter**: `priority` `is` `Critical`
* **Channel**: `Harness Critical`

**High issues**:

* **Filter**: `priority` `is` `High`
* **Channel**: `Harness High`

#### Filter by entity type <a href="#filter-by-entity-type" id="filter-by-entity-type"></a>

Route alerts based on entity type:

**Application issues**:

* **Filter**: `entitiesData.entities.type` `contains` `APPLICATION`
* **Channel**: `Harness Applications`

**Infrastructure issues**:

* **Filter**: `entitiesData.entities.type` `contains` `HOST`
* **Channel**: `Harness Infrastructure`

#### Enrich with NRQL queries <a href="#enrich-with-nrql-queries" id="enrich-with-nrql-queries"></a>

Add custom data to webhooks:

1. In workflow **Enrich data** step
2. Add **NRQL enrichment**
3. Query:

```sql
SELECT average(duration), count(*) 
FROM Transaction 
WHERE appName = '{{ entitiesData.entities.[0].name }}'
SINCE 1 hour ago
```

4. Reference in custom payload:

```json
{
  "issue_title": "{{ issueTitle }}",
  "enrichment": "{{ nrql.[0].average }} ms avg duration"
}
```

#### Include chart images <a href="#include-chart-images" id="include-chart-images"></a>

Add visual context:

1. In workflow **Enrich data** step
2. Add **Image enrichment**
3. Select chart or dashboard
4. Reference in payload: `{{ imageUrl }}`

***

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>New Relic webhook is not sending notifications to Harness AI SRE</summary>

Test the destination from the Destinations page, verify the workflow is Active, check the workflow filters by removing them to test, and review the New Relic notification logs in the destination details.

</details>

<details>

<summary>New Relic alerts are not appearing in Harness AI SRE</summary>

Check the Harness webhook logs for errors, verify the payload structure in the New Relic destination test, temporarily remove the CEL filter to test, and ensure required fields such as issueTitle and priority exist.

</details>

<details>

<summary>New Relic is creating duplicate issues in Harness AI SRE</summary>

Review the workflow filters to avoid overlaps, use Harness alert routing rules to deduplicate by issue\_id, and filter by triggerEvent to process only specific events.

</details>

<details>

<summary>Closed New Relic issues are not resolving in Harness AI SRE</summary>

Ensure the workflow sends notifications for 'Issue closed' events, and map the closed state in the Harness CEL severity mapping.

</details>

***

### Example: complete integration <a href="#example-complete-integration" id="example-complete-integration"></a>

#### New Relic destination <a href="#new-relic-destination" id="new-relic-destination"></a>

Configure the destination with these settings:

* **Name**: Harness AI SRE
* **Type**: Webhook
* **URL**: `https://app.harness.io/gateway/ai-sre/api/webhooks/wh_abc123`
* **Custom payload**: Enabled (see custom payload tab above)

#### New Relic workflow <a href="#new-relic-workflow" id="new-relic-workflow"></a>

Configure the workflow with these settings:

* **Name**: Critical & High Alerts to Harness
* **Filter**:
  * **Attribute**: `priority`
  * **Operator**: `is one of`
  * **Values**: `Critical`, `High`
* **Enrich**:
  * Add **Image** enrichment with violation chart
* **Notify**: Harness AI SRE Channel
* **Status**: Active

#### Map fields in the Harness webhook <a href="#map-fields-in-the-harness-webhook" id="map-fields-in-the-harness-webhook"></a>

```yaml
title: "{{webhook.issueTitle}}"

message: |
  **New Relic Issue**
  
  **Title**: {{webhook.issueTitle}}
  **Priority**: {{webhook.priority}}
  **State**: {{webhook.state}}
  **Entity**: {{webhook.entitiesData.entities[0].name}} ({{webhook.entitiesData.entities[0].type}})
  
  **Conditions**: {{webhook.accumulations.conditionName[0]}}
  **Policy**: {{webhook.accumulations.policyName[0]}}
  
  **Account**: {{webhook.nrAccountName}} ({{webhook.nrAccountId}})
  **Created**: {{webhook.createdAt}}
  **Updated**: {{webhook.updatedAt}}
  
  **View Issue**: {{webhook.issuePageUrl}}
  **Violation Chart**: {{webhook.violationChartUrl}}

severity: |
  webhook.state == "CLOSED" ? "info" :
  webhook.priority == "CRITICAL" ? "critical" :
  webhook.priority == "HIGH" ? "high" :
  webhook.priority == "MEDIUM" ? "medium" : "low"

source: "new-relic"
link: "{{webhook.issuePageUrl}}"

tags:
  - "source:new-relic"
  - "issue_id:{{webhook.issueId}}"
  - "priority:{{webhook.priority}}"
  - "state:{{webhook.state}}"
  - "entity:{{webhook.entitiesData.entities[0].name}}"
  - "entity_type:{{webhook.entitiesData.entities[0].type}}"
  - "account:{{webhook.nrAccountName}}"

filter: |
  webhook.state in ["ACTIVATED", "CREATED", "UPDATED"] &&
  webhook.priority in ["CRITICAL", "HIGH"]

custom_fields:
  issue_id: "{{webhook.issueId}}"
  entity_id: "{{webhook.entitiesData.entities[0].id}}"
  account_id: "{{webhook.nrAccountId}}"
  violation_chart_url: "{{webhook.violationChartUrl}}"
  condition_names: "{{webhook.accumulations.conditionName}}"
  policy_names: "{{webhook.accumulations.policyName}}"
```

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* [Route alerts](/ai-sre/ai-sre-for-administrators/set-up-alert-management/alert-rules/overview.md): Route and deduplicate New Relic issues.
* [Use CEL in webhooks](/ai-sre/ai-sre-for-administrators/set-up-alert-management/webhooks/use-cel-webhooks.md): Add custom filtering logic.
* [AI agent](/ai-sre/ai-sre-for-incident-responders/use-ai-agents/ai-agent.md): Enable automated issue investigation.
* [New Relic template](/ai-sre/ai-sre-for-administrators/set-up-alert-management/webhooks/templates/monitoring/new-relic.md): Use the pre-configured template.

***

### Related documentation <a href="#related-documentation" id="related-documentation"></a>

#### New Relic official documentation <a href="#new-relic-official-documentation" id="new-relic-official-documentation"></a>

* [Applied Intelligence workflows](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/): Complete guide to workflow configuration, destinations, and channels.
* [Notification destinations](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/destinations/): Webhook destination setup and authentication options.
* [Message templates](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/message-templates/): Available template variables (`{{issueId}}`, `{{priority}}`, `{{entitiesData}}`, and others).
* [Customize webhook payload](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/customize-your-webhook-payload/): Complete payload structure and issue fields reference.
