Documentation forAppOptics

Consul

This plugin is currently being groomed to be an integration. It works, but we haven't spent a lot of time on it yet to optimize the user experience. Feel free to try it out, just keep in mind that we will be enhancing the experience over time.

Consul is a tool for discovering and configuring services in your infrastructure. It provides several key features including Service Discovery, Health Checking, a KV Store, and support for Multiple Datacenters.

Setup

The consul plugin is included with the SolarWinds Snap Agent by default, please follow the directions below to enable it for a agent instance.

Prerequisites

The Consul agent must be started beforehand and services you are interested in performing health checks for must be registered to it.

Please visit the Consul website for more information.

Configuration

The agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent. To enable the plugin:

  1. Make a copy of the Consul example configuration file /opt/SolarWinds/Snap/etc/plugins.d/consul.yaml.example, renaming it to /opt/SolarWinds/Snap/etc/plugins.d/consul.yaml:
Copy
$ sudo cp /opt/SolarWinds/Snap/etc/plugins.d/consul.yaml.example /opt/SolarWinds/Snap/etc/plugins.d/consul.yaml
  1. Update the /opt/SolarWinds/Snap/etc/plugins.d/consul.yaml configuration file to set which metrics to report, for example:
Copy
collector:
  consul:
    all:
      ## Most of these values defaults to the one configured on a Consul's agent level.
      ## Optional Consul server address (default: "localhost")
      # address: "localhost"
      ## Optional URI scheme for the Consul server (default: "http")
      # scheme: "http"
      ## Optional ACL token used in every request (default: "")
      # token: ""
      ## Optional username used for request HTTP Basic Authentication (default: "")
      # username: ""
      ## Optional password used for HTTP Basic Authentication (default: "")
      # password: ""
      ## Optional data centre to query the health checks from (default: "")
      # datacentre: ""
load:
  plugin: snap-plugin-collector-bridge-consul
  task: task-bridge-consul.yaml
  1. Restart the agent:
Copy
$ sudo service swisnapd restart
  1. Enable the Consul plugin in AppOptics

    On the Integrations Page you will see the Consul plugin available if the previous steps were successful. If you do not see the plugin, see Troubleshooting Linux.

    Select the Consul plugin to open the configuration menu in the UI, and enable the plugin.

Swisnap fails to start after adding consul config

If you're seeing errors after restarting the swisnapd service, you may need to change the address setting in the /opt/SolarWinds/Snap/etc/plugins.d/consul.yaml file.

By default, the plugin will attempt to query the consul service on localhost (often 127.0.0.1:80), but the consul agent itself runs on 127.0.0.1:8500 by default.

After making the change, restart the service:

Copy
$ sudo service swisnapd restart

Default Metrics

The Consul plugin collects all statistics about the health checks registered to the agent by querying the Consul API. Telemetry statistics are also available which you can collect using the StatsD protocol if needed.

Namespace Description
consul.consul_health_checks.check_name Name of the check/sample
consul.consul_health_checks.service_id ID of the service
consul.consul_health_checks.status Name of health check state (one of passing, critical, warning)
consul.consul_health_checks.passing Integer representation of health check state - a value of 1 indicates this was the status at time of sampling
consul.consul_health_checks.critical Integer representation of health check state - a value of 1 indicates this was the status at time of sampling
consul.consul_health_checks.warning Integer representation of health check state - a value of 1 indicates this was the status at time of sampling

Tags

The table below outlines the default set of tags provided for each metric.

Tag Name Description
node Which node the check/service is registered on
service_name Name of the service
check_id ID of the check/sample
hostname Name of the host. Instead of using this tag we recommend using the @host alias.

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.