Route New Relic Alerts to On Call
Asked by Paul Donnelly:

Hello,

I have set up an integration in OpsGenie and New Relic.  
Currently the integration in OpsGenie receives both Critical and Moderate alerts into the OpsGenie integration from New Relic

Is there a way that I can configure OpsGenie so that only Critical alerts from New Relic go to our on call engineer from 5pm to 08.30am?  
And then both critical and moderate alerts go to the whole team from 08.30am to 5pm?

Thanks


Answers:
author: Nick H
body: Hi [@Paul Donnelly](/t5/user/viewprofilepage/user-id/5125498) ,

That should be possible. You'd first want to extract the field(s) that determines these alerts are critical or moderate - whether it's a tag, [custom field](https://community.atlassian.com/t5/Opsgenie-articles/How-to-Extract-Custom-Fields-and-Data-into-an-Alert/ba-p/2133902), etc.

After, you could use routing rules to filter on the alert field determining if these alerts are critical or moderate, and route to a specific escalation depending on the time of day.

For example:

![rr1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/235342i4DB8F0E4321C1CD9/image-size/large?v=v2&px=999 "rr1.jpg")

![rr2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/235338iE5D6C8CAF53EDD42/image-size/large?v=v2&px=999 "rr2.jpg")

\^ If an alert is created and matches the filter / time restrictions of the top routing rule, alerts will be routed to the After Hours escalation - which only notifies the on-call user(s).

If an alert is created and does **not** match the filter / time restrictions of the top routing rule, the default routing rule (ELSE) will route alerts to the Business Hours escalation - which notifies all members of the team.

comments: author: Paul Donnelly
body: Thanks [@Nick H](/t5/user/viewprofilepage/user-id/2540930) I worked out that part eventually :-)

Just one thing I'm not sure of is this message![Route alert.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/235345iE01B1D91F1F9936F/image-size/large?v=v2&px=999 "Route alert.PNG")

Does this mean that when I have my on call route setup for P1 issues, OpsGenie will now ignore any other escalation polices I have?  
For example I have a policy that has alerts 08.30am to 5pm? I need the P1 issues to notify the team during these hours

Thanks


author: Nick H
body: Hi [@Paul Donnelly](/t5/user/viewprofilepage/user-id/5125498) ,

That's a warning to inform customers an escalation is not apart of the workflow with the routing rule. Routing alerts directly to a schedule will essentially skip over the escalation(s) entirely. If the use case were to notify others if the on-call user(s) do not take action, then you'd want to route to an escalation.

But with your use case to only notify the on-call user(s) for critical after hours alerts, then you can leave it as is! You realistically do not need an escalation for that routing rule.


author: Paul Donnelly
body: [@Nick H](/t5/user/viewprofilepage/user-id/2540930) excellent thanks!

Just one more thing. I've now set up my on call route to notify the on call engineer based on the days/times shown. Alerts are then routed to the on call schedule (which contains information about who is on call and when)

I'm seeing an information message as shown. Is this OK? I couldn't see it on your setup

![alerts.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/235347iC4C54EACC153234E/image-size/large?v=v2&px=999 "alerts.PNG")


author: Nick H
body: Hi [@Paul Donnelly](/t5/user/viewprofilepage/user-id/5125498) ,

If I were to edit my routing rule to send alerts directly to the team's schedule instead of an escalation, I'd have the same UI / warning:

![rr3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/235355i4E5AAAD755A6FBC3/image-size/large?v=v2&px=999 "rr3.jpg")

It's the same warning from your other response, but a different view.


Tags: cloud