HashiCorp Consul Integration Guide

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.

In PagerDuty

  1. From the Services menu, select Service Directory
  2. On your Service Directory page:

    If you are creating a new service for your integration, click + 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 Add a new integration.

  3. 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.
  4. Click the Add Service or Add Integration button to save your new integration. You will be redirected to the Integrations page for your service.
    Screenshot of adding HashiCorp Integration to Service
  5. Copy the Integration Key for your new integration. RS_API_pd_3

On the Consul server:

  1. Install Consul-Alerts as per the guide at https://github.com/AcalephStorage/consul-alerts/blob/master/README.md
  2. 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
  3. (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
  4. 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.

FAQ

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.

Start Using PagerDuty Today

Try PagerDuty free for 14 days — no credit card required.

SIGN UP