Consul is a tool for discovering and configuring services in your infrastructure. It is a distributed, highly available system. Consul provides service discovery, health checks, a key/value store and supports multiple datacenters out of the box.
- From the Configuration menu, select Services.
- On your Services page:
If you are creating a new service for your integration, click +Add New Service.
If you are adding your integration to an existing service, click the name of the service you want to add the integration to. Then click the Integrations tab and click the +New Integration button.
- Select your app from the Integration Type menu and enter an Integration Name.
If you are creating a new service for your integration, in General Settings, enter a Name for your new service. Then, in Incident Settings, specify the Escalation Policy, Notification Urgency, and Incident Behavior for your new service.
- Click the Add Service or Add Integration button to save your new integration. You will be redirected to the Integrations page for your service.
- Copy the Integration Key for your new integration.
On the Consul server:
- Install Consul-Alerts as per the guide at https://github.com/AcalephStorage/consul-alerts/blob/master/README.md
- Once Consul-Alerts is running, we can configure the PagerDuty integration key using curl.
curl -X PUT -d 'INTEGRATION_KEY_HERE' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/pagerduty/service-key
- (Optional) Set a client name and URL to show up in PagerDuty incident details using curl.
curl -X PUT -d 'Consul' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/pagerduty/client-name
curl -X PUT -d 'http://my.consul-host.local/web/' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/pagerduty/client-url
- Enable PagerDuty notifications in Consul-Alerts.
curl -X PUT -d 'true' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/pagerduty/enabled
Consul should now be able to trigger and resolve incidents in PagerDuty. We recommend generating a test incident by having a health check fail to confirm the integration is working.
Can Consul be integrated with multiple PagerDuty services?
No, Consul-Alerts only supports sending incidents to a single PagerDuty service.
Will incidents automatically resolve once the heath checks are passing in Consul?
Yes, Consul-Alerts will resolve the PagerDuty incident once health checks are passing.