Consul is a tool for discovering and configuring services in your infrastructure. It provides several key features such as Service Discovry, Health Checking, Key/Value store and Multi Datacenters. OpsGenie is an alert and notification management solution that is complementary to Consul.
What does OpsGenie offer to Consul users?
Using OpsGenie Consul integration, Consul sends its alerts to OpsGenie API, with detailed information. OpsGenie acts as a dispatcher for Consul alerts, determining the right people to notify based on on-call schedules, using email, text messages (SMS), phone calls and iPhone & Android push notifications, and escalating alerts until the alert is acknowledged or closed.
Functionality of the integration
- When Consul triggers an alert, an alert is created in OpsGenie automatically through the integration.
Add Consul integration in OpsGenie
- Please create an OpsGenie account if you haven't done already
- Go to OpsGenie Consul Integration page,
- Specify who should be notified for Consul alerts using the "Recipients" field. User(s), group(s), escalations policies and on-call schedules can be specified as the alert recipients. Auto-complete suggestions will be provided as you type.
- Copy the integration API key by clicking on the copy button or selecting. You'll be using this key in Consul configuration.
- Click on "Save Integration".
Configuration on the Consul server
- Apply the instructions below from your Consul Server
- Install Consul-Alerts as shown here
- Once Consul-Alerts is running, we can configure the OpsGenie api key. (Note: The consul agent's IP and port may vary)
curl -X PUT -d 'API_KEY' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/opsgenie/api-key
- (Optional) Set the entity field value to show up in OpsGenie alert details (Default is "Cluster-Alert").
curl -X PUT -d 'true' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/opsgenie/enabled
- Enable OpsGenie notifications in Consul-Alerts
curl -X PUT -d 'Consul' http://localhost:8500/v1/kv/consul-alerts/config/notifiers/opsgenie/cluster-name
- When a Consul healthcheck becomes critical, an OpsGenie alert is automatically created
- When the Consul healthcheck becomes passing again, the OpsGenie alert is automatically closed
All done! You can now manage your Consul health-checks at OpsGenie and leverage OpsGenie's full alerting functionality.