New Relic Integration Guide
New Relic is a cloud service that allows the performance of websites and technical applications to be monitored. TaskCall's integration with New Relic allows alerts generated by policy breaches to be converted into incidents and gets the correct on-call responders to attend them in real-time. With TaskCall's New Relic integration enhance your system reliability and customer satisfaction.
Pointers
- The integration is between a TaskCall service and New Relic.
- Incidents will automatically resolve in TaskCall when metrics fall back within the normal threshold.
- Incidents will be acknowledged in TaskCall when they are acknowledged in New Relic.
- This integration only allows alerts to be received in TaskCall from New Relic.
In TaskCall
- Go to Configurations > Integrations and click New Integration.
- Select the New Relic integration.
- Give the integration a name and configure how incidents will be created. Only the Default Service field is required. The rest are optional.
- Incidents (Optional)
- TaskCall automatically maps incoming payloads with internal attributes to create incidents. However, this can be customized in the Incidents tab. Constant values can be included alongside placeholders to dictate which attributes should map to the Incident Title, Description, Tags, Snapshots and Vendor URL. To insert a placeholder use double curly braces.
For example, if you enter {{ alert.title }} in the Incident Title field, TaskCall will look for an attribute called "title" nested inside another attribute called "alert" in the incoming payload. If the nested attribute exists, its corresponding value will be pulled from the payload and inserted. If the nested attribute does not resolve successfully, TaskCall will fall back to the default mapping.
If you are unsure, please leave the fields empty. TaskCall will use the default mapping to create the incident for you. - Select the Urgency level the incident should be created at.
- Select the option to Group similar alerts together if you would like follow up triggers from the same alert source to be grouped into the same incident. If you leave this option unchecked, then a new incident will be created for every trigger. (This behavior is specific to new triggers; not updates to an alert.)
- Click Next to move on to the Services tab.
- TaskCall automatically maps incoming payloads with internal attributes to create incidents. However, this can be customized in the Incidents tab. Constant values can be included alongside placeholders to dictate which attributes should map to the Incident Title, Description, Tags, Snapshots and Vendor URL. To insert a placeholder use double curly braces.
- Services (Required)
- Select the Default Service incidents should be sent to. To route incidents to different services instead, set Map With Attribute to the attribute to route by using a placeholder. Then, map each value it can take to the service that should receive it.
For example, to route by a region attribute sent in the payload, set Map With Attribute to {{ region }}, then map US to one service and EU to another, and so on.
- Click Next to move on to the Authorization tab.
- Select the Default Service incidents should be sent to. To route incidents to different services instead, set Map With Attribute to the attribute to route by using a placeholder. Then, map each value it can take to the service that should receive it.
- Authorization (Optional)
- The Authorization tab allows a Bearer Token and an IP Allowlist be added if you would like to restrict who is able to send alerts to this integration. If you are unsure, this can be skipped.
- Once done, click Save.
- Copy the Integration Url that is issued for the integration. This will be used to set up the notification in New Relic.
In New Relic
In New Relic you will need to create a new destination and a workflow to ensure alerts are dispatched to TaskCall when certain policies are met.
- Go to Alerts > Destinations. Add a new Webhook destination.
- Give the webhook a name and paste the integration url you copied over from TaskCall in the Endpoint URL field. No authorization is needed. Click Save Destination when you are done.
- Now go to Alerts > Workflows. Add a new workflow.
- Give the workflow a name. Select the policies for which this workflow should apply and the priority with which they will be sent. In the Notify section, select Webhook. This will open up another modal where you can define the notification destination and message.
- In the notification modal, select the TaskCall destination you created earlier as the Destination for this notification. You can leave the body of the message to be the default template set by New Relic. If you want to customize it, please refer to the attributes TaskCall expects. When you are done, send a test notification to ensure the integration is working correctly. Click Save message when you are done.
- Click Activate workflow when you are done. That's it!
Alert Payload
TaskCall expects the following payload from New Relic. If a different payload is sent, TaskCall will still try to create an incident with it with the available data.
"id": {{ json issueId }},
"issueUrl": {{ json issuePageUrl }},
"title": {{ json annotations.title.[0] }},
"priority": {{ json priority }},
"impactedEntities": {{json entitiesData.names}},
"totalIncidents": {{json totalIncidents}},
"state": {{ json state }},
"trigger": {{ json triggerEvent }},
"isCorrelated": {{ json isCorrelated }},
"createdAt": {{ createdAt }},
"updatedAt": {{ updatedAt }},
"sources": {{ json accumulations.source }},
"alertPolicyNames": {{ json accumulations.policyName }},
"alertConditionNames": {{ json accumulations.conditionName }},
"workflowName": {{ json workflowName }}
}
Customize Incident Body
By default, TaskCall shows the JSON payload received from New Relic as the body of the incident. However, it can be customized by passing a details attribute in the payload. The details attribute can be a single value or it can be a key/value pair. The value will always be converted into a string upon receipt in TaskCall. Here is an example of how the details attribute can be used:
"createdAt": {{ createdAt }},
"sources": {{ json accumulations.source }},
"details": {
"impactedEntities": {{json entitiesData.names}},
"totalIncidents": {{ json totalIncidents}},
"alertPolicyNames": {{ json accumulations.policyName }}
},
"workflowName": {{ json workflowName }},
...