Integrations3 min read
New Relic
Receive New Relic alerts and incidents in OpsKnight
New Relic Integration
Receive alerts from New Relic and create incidents automatically.
Endpoint
POST /api/integrations/newrelic?integrationId=YOUR_INTEGRATION_ID
Setup
Step 1: Create Integration in OpsKnight
- Go to Services and select your service
- Click Integrations tab
- Click Add Integration
- Select New Relic
- Copy the Integration ID
Step 2: Configure New Relic Webhook
- In New Relic, go to Alerts & AI → Destinations
- Click + Add destination
- Select Webhook
- Configure:
| Field | Value |
|---|---|
| Name | OpsKnight |
| Endpoint URL | https://YOUR_OPSKNIGHT_URL/api/integrations/newrelic?integrationId=YOUR_INTEGRATION_ID |
- Click Save destination
Step 3: Create Workflow
- Go to Alerts & AI → Workflows
- Click + Add workflow
- Configure filter conditions
- Add Notify action with the OpsKnight destination
- Save the workflow
Supported Formats
OpsKnight automatically detects and handles multiple New Relic payload formats:
Incident Format (Workflows)
{
"account_id": 12345,
"account_name": "My Account",
"event_type": "INCIDENT_CREATED",
"incident": {
"id": "inc-abc123",
"title": "High CPU usage on production servers",
"state": "open",
"severity": "critical",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z",
"condition_name": "CPU Usage > 90%",
"condition_id": 67890,
"policy_name": "Production Alerts",
"policy_id": 11111
}
}
Legacy Alert Format
{
"alert": {
"id": "alert-xyz789",
"alert_policy_name": "Production Alerts",
"alert_condition_name": "High Memory Usage",
"severity": "warning",
"timestamp": 1705312800,
"state": "open",
"message": "Memory usage exceeded 85%"
}
}
APM Format
{
"alertType": "VIOLATION_OPEN",
"alertSeverity": "critical",
"alertTitle": "Error rate too high",
"alertMessage": "Error rate exceeded 5% threshold",
"alertTimestamp": 1705312800,
"account_id": 12345
}
Event Mapping
| New Relic State | OpsKnight Action |
|---|---|
open |
Trigger incident |
acknowledged |
Acknowledge incident |
resolved, closed |
Resolve incident |
For APM format, resolved/closed keywords in alertType trigger resolution.
Severity Mapping
| New Relic Severity | OpsKnight Severity |
|---|---|
critical |
critical |
warning |
warning |
info |
info |
Incident Title
The incident title is extracted based on format:
Incident format: incident.title
Legacy format: alert.alert_condition_name or alert.message
APM format: alertTitle
Deduplication
Dedup keys are generated based on format:
- Incident format:
newrelic-{incident.id} - Legacy format:
newrelic-{alert.id} - APM format:
newrelic-{alertTimestamp}
Security
Signature Verification (Optional)
You can secure the webhook with HMAC signature verification:
- In OpsKnight, set a Signing Secret on the integration
- Include header:
X-Signature: sha256=<hmac_signature>
Testing
Using New Relic UI
- Go to Alerts & AI → Workflows
- Select your workflow
- Click Test workflow
- Verify incident appears in OpsKnight
Using cURL
Send a test payload directly:
curl -X POST "https://YOUR_OPSKNIGHT_URL/api/integrations/newrelic?integrationId=YOUR_ID" \
-H "Content-Type: application/json" \
-d '{
"account_id": 12345,
"account_name": "Test Account",
"incident": {
"id": "test-incident-001",
"title": "Test Alert from New Relic",
"state": "open",
"severity": "warning",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
}'
Troubleshooting
Alerts Not Appearing
- Check destination URL is correct
- Verify integration ID is valid
- Check workflow is active and correctly configured
- Test destination in New Relic settings
Incidents Not Resolving
- Verify workflow sends close notifications
- Check incident state is being sent correctly
Unknown Format Warning
If you see "unknown format" in incident details:
- Check payload matches one of the supported formats
- Verify JSON is valid
- Contact support if using a new New Relic notification format
Related Topics
- Events API — Programmatic event submission
- Integrations Overview — All integrations
Last updated for v1
Edit this page on GitHub