PagerDuty Integration
Create a PagerDuty integration, save its key as a target, and test incident delivery.
Use this guide to create a PagerDuty incident when PayloadRelay receives a webhook payload.
Purpose#
Use this guide to:
- Create a PagerDuty service integration.
- Save the integration key as a relay target.
- Attach the target to an endpoint destination.
- Create a test incident with a test delivery.
Before you start#
- A PagerDuty account with permission to create a service or an integration.
- Access to
Relay targetsandEndpointsin PayloadRelay.
Payload format#
PayloadRelay sends a PagerDuty Events API v2 trigger event:
{
"routing_key": "<your-integration-key>",
"event_action": "trigger",
"dedup_key": "<endpoint-id>:<delivery-uuid>",
"payload": {
"summary": "<first 1024 chars of stringified payload or endpoint name>",
"source": "PayloadRelay",
"severity": "<info|warning|error|critical>",
"custom_details": { ...original payload... }
}
}The dedup_key is stable for each delivery, with the retries. PagerDuty thus puts more than one retry of the same event into one incident.
If the inbound payload is not a JSON object, PayloadRelay puts it in an object before it sends the payload to PagerDuty. This applies to plain text, XML text, an array, and a scalar JSON value:
{
"payload": "<original payload>",
"payloadText": "<stringified payload>"
}Severity#
The default severity is error. You can change the severity of the relay target to info, warning, error, or critical.
Procedure#
1. Create a PagerDuty service integration#
- In PagerDuty, open
Servicesand select your service, or create a service. - Select the
Integrationstab, then selectAdd an integration. - Select
Events API v2as the integration type. - Select
Add. PagerDuty makes anIntegration Key, which is a 32-character hexadecimal string. - Copy the integration key.
2. Add a PagerDuty relay target#
- Open
Relay targetsin PayloadRelay. - Select
Add target. - Select
PagerDutyas the type. - Paste the
Integration Keyinto the field.- The key must have exactly 32 hexadecimal characters.
- PayloadRelay stores the key encrypted, and it does not show the key after you save.
- Select the PagerDuty severity for the incidents that this target creates.
- If a name and a description are necessary, add them. Then save.
The target needs no email confirmation. It is available immediately.
You can create more than one PagerDuty relay target, for example, one target for each PagerDuty service or integration key. Give each target a clear name, and you can then select the correct service in the endpoint destinations.
3. Attach the target to an endpoint#
- Open the endpoint create page or the endpoint edit page.
- In
Outputs, select the PagerDuty target. - Save the endpoint.
4. Test delivery#
- On the
Relay targetspage, find the PagerDuty target and selectSend test. - PayloadRelay sends a
triggerevent, then aresolveevent with the samededup_key. The test leaves no open incident. - Make sure that PagerDuty shows an incident that opened for a short time and then resolved.
Security#
- PayloadRelay stores the integration key in a safe location, and it does not show the key after you save.
- To change the key, edit the target and enter the new key.
Retry behavior#
A failed delivery uses the standard automatic retry schedule of PayloadRelay, in the limit of the plan. PayloadRelay retries a temporary PagerDuty error automatically.
Troubleshooting#
| Symptom | Likely cause | Fix |
|---|---|---|
| 400 Invalid Routing Key | A wrong integration key | Edit the target and enter the correct 32-character hexadecimal key. |
| No incident | The service is disabled or in maintenance | Read the status of the PagerDuty service. |
| Duplicate incidents | A different dedup_key for each retry | Contact Support. |
| PayloadRelay rejects the integration key when you save | The key does not have 32 hexadecimal characters | Make sure that the key has 32 hexadecimal characters. |