PagerDuty alert integration

Get your PagerDuty API Key

Go to the Configuration menu and select API Access. Click Create New API Key.

More info on generating API Token key: https://support.pagerduty.com/hc/en-us/articles/202829310-Generating-an-API-Key

CoScale uses the v2 PagerDuty API.

PagerDuty API Key

Get your Service ID

  • Go to the Service > Service details page in PagerDuty
  • The URL has this format: https://<NAME>.pagerduty.com/services/<SERVICE ID>
  • Copy the <SERVICE ID> from the URL

PagerDuty Service ID

In CoScale we will use the API integration to create push alerts to PagerDuty.

Trigger configuration

Method: POST
URL: https://api.pagerduty.com/incidents

Body:
{
	"incident": {
		"type": "incident",
		"title": "Alert {ACTION} for {MSG} {METRIC}{SUBJECT}{DIMENSIONS}at {TIME} ({DATE}) on application {APP_NAME}. {LINK}",
		"service": {
			"id": "PXFL9LI",
			"type": "service_reference"
		}
	}
}

Headers:
	Content-Type: application/json
	Accept: application/vnd.pagerduty+json;version=2
	Authorization: Token token=zXg83wYr26nyx_3GVPy7
	From: your@email.here

Parse response: JSON incident.id

PagerDuty CoScale

Acknowledge configuration

Method: PUT
URL: https://api.pagerduty.com/incidents

Body:
{
	"incidents": [{
		"id": "{ID}",
		"type": "incident_reference",
		"status": "acknowledged"
	}]
}

Headers:
	Content-Type: application/json
	Accept: application/vnd.pagerduty+json;version=2
	Authorization: Token token=zXg83wYr26nyx_3GVPy7
	From: your@email.here

Resolve configuration

Method: PUT
URL: https://api.pagerduty.com/incidents
Body:
{
	"incidents": [{
		"id": "{ID}",
		"type": "incident_reference",
		"status": "resolved"
	}]
}

Headers:
	Content-Type: application/json
	Accept: application/vnd.pagerduty+json;version=2
	Authorization: Token token=zXg83wYr26nyx_3GVPy7
	From: your@email.here