Webhook examples (legacy)

Deprecated

This applies only to the legacy alerting system. You can transition from legacy alerting to New Relic Alerts.

New Relic supports a single webhook for web applications, host monitoring, key transactions, mobile apps, and more. New Relic will push top-level values in the JSON hash for different types of events, such as deployments and alert threshold violations.

Before your New Relic account's Owner or Admins can set up webhook notifications for the legacy alerting system in New Relic, they must set an endpoint (URL) on your side that will trigger customized behaviors when the endpoint receives the necessary post from New Relic. Then, the next time your app or host experiences a supported event, New Relic automatically posts JSON-encoded data with the event's details to that URL, and the customized behavior takes over.

Create webhooks (legacy)

Owner or Admins

Do not include any custom, self-signed SSL certificates in your webhook. New Relic agents enable SSL by default. Due to New Relic's security policy, custom SSL certificates will not be imported into New Relic's Trust store.

If you want to include a port number in the webhook URL, make sure the port is available for requests. Otherwise the webhook will not work.

After setting up the webhook in New Relic's user interface for legacy alerts, select the option to test your webhook. You can also use sites such as RequestBin for troubleshooting.

Web app alert policy examples (legacy)

The following webhook examples have extra spaces and line breaks for readability. The actual responses are delivered as one continuous line of text.

Legacy web app alert policy opened (generic)

This is a generic webhook example for opening a web application alert policy after the JSON has been decoded.

{
"created_at":"2014-03-04T14:31:35+00:00",
"alert_policy_name":"Default application alert policy",
"account_name":"Account name",
"severity":"Critical",
"message":"Message about alert",
"short_description":"Short description about alert",
"long_description":"Long description about alert",
"alert_url":"http://PATH_TO_NEW_RELIC"
}
Legacy web app alert policy closed (generic)

This is a generic webhook example for closing a web application alert policy after the JSON has been decoded.

{
"created_at":"2014-03-04T22:31:35+00:00",
"alert_policy_name":"Default application alert policy",
"account_name":"Account name",
"severity":"Critical",
"message":"Message about alert",
"short_description":"Short description about alert ended",
"long_description":"Long description about alert ended",
"alert_url":"http://PATH_TO_NEW_RELIC",
"application_name":""
}
Legacy web app incident and Apdex problem opened

This is a webhook example for opening a web app alert policy triggered when the Apdex setting is <0.85.

{
"account_name":"Account name",
"alert_policy_name":"Default application alert policy",
"alert_url":"http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
"application_name" : "RPM Local",
"created_at":"2014-05-01T20:29:56+00:00",
"long_description":"Alert opened for Default application alert policy -- Triggered by: Apdex < 0.85 -- Apps currently involved: RPM Local",
"message" : "Apdex < 0.85",
"severity":"critical",
"short_description":"New alert for Default application alert policy: Apdex < 0.85"
}
Legacy incident escalated to downtime

This is a webhook example of an escalated alert policy to a downtime alert when New Relic is unable to ping the app.

{
"account_name":"Account name",
"alert_policy_name":"Default application alert policy",
"alert_url":"http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
"application_name" : "RPM Local",
"created_at":"2014-05-01T20:29:56+00:00",
"long_description":"Alert escalated to downtime for Default application alert policy -- Triggered by: unable to ping site.com -- Apps currently involved: RPM Local",
"message" : "unable to ping site.com",
"severity" : "downtime",
"short_description":"Escalated severity for Default application alert policy: unable to ping site.com"
}
Legacy incident acknowledged

This is a webhook example for acknowledging a web app alert incident.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default application alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
  "application_name" : "",
  "created_at" : "2014-05-01T20:29:56+00:00",
  "long_description" : "Alert acknowledged by Bob Smith for Default application alert policy -- Apps currently involved: RPM Local",
  "message" : "Apdex < 0.85",
  "severity" : "downtime",
  "short_description" : "Alert for Default application alert policy acknowledged by Bob Smith"
}
Legacy Apdex problem closed

This is a webhook example when the Apdex problem for a web app alert closes.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default application alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
  "application_name" : "RPM Local",
  "created_at" : "2014-05-01T20:29:56+00:00",
  "long_description" : "Alert ended for Default application alert policy -- Triggered by: Apdex < 0.85 -- Apps currently involved: RPM Local",
  "message" : "Apdex < 0.85",
  "severity" : "downtime",
  "short_description" : "Ended alert for Default application alert policy: Apdex < 0.85"
}
Legacy downtime problem closed

This is a webhook example when the New Relic is able to ping the web app again.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default application alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
  "application_name" : "RPM Local",
  "created_at" : "2014-05-01T20:29:56+00:00",
  "long_description" : "Alert downtime recovered for Default application alert policy -- Triggered by: unable to ping site.com -- Apps currently involved: RPM Local",
  "message" : "unable to ping site.com",
  "severity" : "downtime",
  "short_description" : "Downtime recovered for Default application alert policy: unable to ping site.com"
}
All legacy alerts closed for this incident

This is a webhook example when all alerts that triggered the web app alert policy have closed.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default application alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
  "application_name" : "",
  "created_at" : "2014-05-01T20:29:56+00:00",
  "long_description" : "Alert ended for Default application alert policy -- All alerts have been closed for this incident -- Apps currently involved: RPM Local",
  "message" : "Apdex < 0.85",
  "severity" : "critical",
  "short_description" : "All alerts have been closed for this incident"
}
Legacy incident disabled or canceled

This is a webhook example to disable or cancel the alert that triggered the web app's alert policy.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default application alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/496",
  "application_name" : "",
  "created_at" : "2014-05-01T20:29:56+00:00",
  "long_description" : "Alert canceled: Policy disabled for Default application alert policy  -- Apps currently involved: RPM Local",
  "message" : "Apdex < 0.85",
  "severity" : "critical",
  "short_description" : "Alert for Default application alert policy canceled: Policy disabled"
}

Key transaction alert policy examples (legacy)

The following webhook examples have extra spaces and line breaks for readability. The actual responses are delivered as one continuous line of text.

Legacy key transaction alert policy opened (generic)

This is a webhook example for opening a key transaction alert policy after the JSON has been decoded.

{
"created_at":"2014-03-04T14:31:35+00:00",
"alert_policy_name":"Default key_transaction alert policy",
"account_name":"Account name",
"severity":"Critical",
"message":"Message about alert",
"short_description":"Short description about alert",
"long_description":"Long description about alert",
"alert_url":"http://PATH_TO_NEW_RELIC",
"application_name":"RPM Local"
}
Legacy key transaction alert policy closed (generic)

This is a webhook example for closing a key transaction alert policy after the JSON has been decoded.

{
"created_at":"2014-03-04T22:31:35+00:00",
"alert_policy_name":"Default key_transaction alert policy",
"account_name":"Account name",
"severity":"Critical",
"message":"Message about alert",
"short_description":"Short description about alert ended",
"long_description":"Long description about alert ended",
"alert_url":"http://PATH_TO_NEW_RELIC",
"application_name":"RPM Local"
}
Legacy incident and error rate problem opened

This is a webhook example when the key transaction incident opens and the error rate is > 5%.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default key_transaction alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/497",
  "application_name" : "RPM Local",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert opened for Default key_transaction alert policy -- Triggered by: Error rate > 5% -- Key transactions currently involved: App Index",
  "message" : "Error rate > 5%",
  "severity" : "critical",
  "short_description" : "New alert for Default key_transaction alert policy: Error rate > 5%"
}
Legacy incident acknowledged

This is a webhook example for acknowledging a key transaction's alert incident.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default key_transaction alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/497",
  "application_name" : "",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert acknowledged by Bob Smith for Default key_transaction alert policy  -- Key transactions currently involved: App Index",
  "message" : "Error rate > 5%",
  "severity" : "critical",
  "short_description" : "Alert for Default key_transaction alert policy acknowledged by Bob Smith"
}
Legacy error rate problem closed

This is a webhook example when the key transaction's error rate problem ends.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default key_transaction alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/497",
  "application_name" : "RPM Local",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert ended for Default key_transaction alert policy -- Triggered by: Error rate > 5% -- Key transactions currently involved: App Index",
  "message" : "Error rate > 5%",
  "severity" : "critical",
  "short_description" : "Ended alert for Default key_transaction alert policy: Error rate > 5%"
}
All legacy alerts closed for this incident

This is a webhook example when all alerts that triggered the key transaction's alert policy have closed.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default key_transaction alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/497",
  "application_name" : "",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert ended for Default key_transaction alert policy -- All alerts have been closed for this incident -- Key transactions currently involved: App Index",
  "message" : "Error rate > 5%",
  "severity" : "critical",
  "short_description" : "All alerts have been closed for this incident"
}
Legacy incident disabled or canceled

This is a webhook example to disable or cancel the alert that triggered the key transaction's alert policy.

{ "account_name" : "Account name",
  "alert_policy_name" : "Default key_transaction alert policy",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/497",
  "application_name" : "",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert canceled: Policy disabled for Default key_transaction alert policy  -- Key transactions currently involved: App Index",
  "message" : "Error rate > 5%",
  "severity" : "critical",
  "short_description" : "Alert for Default key_transaction alert policy canceled: Policy disabled"
}

Mobile app alert policy examples (legacy)

The following webhook examples have extra spaces and line breaks for readability. The actual responses are delivered as one continuous line of text.

Legacy mobile app incident opened: Failed call rate problem

This is a webhook example when the mobile app incident opens due to a failed call rate problem.

{ "account_name" : "Account name",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/498",
  "application_name" : "My mobile app",
  "created_at" : "2014-05-01T22:06:33+00:00",
  "long_description" : "Alert opened on My mobile app: Network failure rate for services.site.com of 43.577% > 10.0%",
  "message" : "Network failure rate for services.site.com of 43.577% > 10.0%",
  "severity" : "critical",
  "short_description" : "My mobile app alert opened"
}
Legacy incident acknowledged

This is a webhook example for acknowledging a mobile app's alert incident.

{ "account_name" : "Account name",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/498",
  "application_name" : "RPM Local",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert acknowledged by Bob Smith on My mobile app: Network failure rate for services.site.com of 43.577% > 10.0%",
  "message" : "Network failure rate for services.site.com of 43.577% > 10.0%",
  "severity" : "critical",
  "short_description" : "My mobile app alert acknowledged by Bob Smith"
}
Legacy incident closed

This is a webhook example when the mobile app's rate problem ends.

{ "account_name" : "Account name",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/498",
  "application_name" : "My mobile app",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert ended on My mobile app: Network failure rate for services.site.com of 43.577% > 10.0%",
  "message" : "Network failure rate for services.site.com of 43.577% > 10.0%",
  "severity" : "critical",
  "short_description" : "My mobile app alert ended"
}

Plugin alert policy examples (legacy)

The following webhook examples have extra spaces and line breaks for readability. The actual responses are delivered as one continuous line of text.

Legacy plugin incident opened: Custom metric problem

This is a webhook example when the plugin incident opens due to a custom metric problem for a component or instance.

{ "account_name" : "Account name",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/499",
  "application_name" : "My plugin",
  "created_at" : "2014-05-01T22:06:33+00:00",
  "long_description" : "Alert opened on My plugin: Waiting Connections > 2",
  "message" : "Waiting Connections > 2",
  "severity" : "critical",
  "short_description" : "My plugin alert opened"
}
Legacy plugin incident acknowledged

This is a webhook example for acknowledging a plugin's alert incident.

{ "account_name" : "Account name",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/499",
  "application_name" : "My plugin",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert acknowledged by Bob Smith on My plugin: Waiting Connections > 2",
  "message" : "Waiting Connections > 2",
  "severity" : "critical",
  "short_description" : "My plugin alert acknowledged by Bob Smith"
}
Legacy plugin incident closed

This is a webhook example when the plugin's custom metric problem ends.

{ "account_name" : "Account name",
  "alert_url" : "http://PATH_TO_NEW_RELIC/accounts/nnn/incidents/499",
  "application_name" : "My plugin",
  "created_at" : "2014-05-01T21:40:54+00:00",
  "long_description" : "Alert ended on My plugin: Waiting Connections > 2%",
  "message" : "Waiting Connections > 2",
  "severity" : "critical",
  "short_description" : "My plugin alert ended"
}

For more help

Recommendations for learning more: