# Integrate Spike with New Relic

## Service and integration

New Relic is a platform built to help engineers analyze, troubleshoot, and optimize their entire software stack from one place.

{% content-ref url="create-integration-and-service-on-dashboard" %}
[create-integration-and-service-on-dashboard](https://docs.spike.sh/integrations-guideline/create-integration-and-service-on-dashboard)
{% endcontent-ref %}

## Use Webhook on New Relic

### Step 1

Start by going to **notification channels** in the left menu.

![Select notification channels](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-3d19b86e18065768d3fa6c60a9785feb65ee3c7f%2Fnew-relic-1.png?alt=media)

### **Step 2**

In the Notification Channel, click to create a new channel and select **Webhooks**

![Create a Webhook channel](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-3193ffbcaf0c2a17d8cf6bd93e57d7b6966a4b3f%2Fnew-relic-2.png?alt=media)

### Step 3

* Configure the webhook as shown in the figure and **paste the Spike.sh webhook in Base Url** input.
* Paste the custom payload from below and please make sure to not make any edits to the payload.

```
{
    "account_id": "$ACCOUNT_ID",
    "account_name": "$ACCOUNT_NAME",
    "closed_violations_count_critical": "$CLOSED_VIOLATIONS_COUNT_CRITICAL",
    "closed_violations_count_warning": "$CLOSED_VIOLATIONS_COUNT_WARNING",
    "condition_family_id": "$CONDITION_FAMILY_ID",
    "condition_id": "$CONDITION_ID",
    "condition_name": "$CONDITION_NAME",
    "current_state": "$EVENT_STATE",
    "details": "$EVENT_DETAILS",
    "duration": "$DURATION",
    "event_type": "$EVENT_TYPE",
    "incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL",
    "incident_id": "$INCIDENT_ID",
    "incident_url": "$INCIDENT_URL",
    "open_violations_count_critical": "$OPEN_VIOLATIONS_COUNT_CRITICAL",
    "open_violations_count_warning": "$OPEN_VIOLATIONS_COUNT_WARNING",
    "owner": "$EVENT_OWNER",
    "policy_name": "$POLICY_NAME",
    "policy_url": "$POLICY_URL",
    "runbook_url": "$RUNBOOK_URL",
    "severity": "$SEVERITY",
    "targets": "$TARGETS",
    "timestamp": "$TIMESTAMP",
    "timestamp_utc_string": "$TIMESTAMP_UTC_STRING",
    "violation_callback_url": "$VIOLATION_CALLBACK_URL",
    "violation_chart_url": "$VIOLATION_CHART_URL",
    "team": "DevOps"
}
```

![Paste webhook and payload to new relic](https://1743514643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ln3jS1bJTTsE3yoEcOu%2Fuploads%2Fgit-blob-0dcbbf8bd9da147ae58f28790cd4e65d00291e52%2Fnew-relic-3.png?alt=media\&token=187f8bf4-0294-4707-8987-f7de28886dda)

{% hint style="info" %}
Customising the payload yourself might affect the incident messages, so please avoid it. Not using custom payloads will most likely cause [incident message parsing to fail](https://docs.spike.sh/incidents/why-does-message-parsing-fail)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spike.sh/integrations-guideline/integrate-spike-with-new-relic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
