Documentation forAppOptics

Consul

Overview

This integration collects metrics from Consul. 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 monitoring is accomplished by bridge plugin which is included with the SolarWinds Snap Agent by default. Follow the directions below to enable it for an agent instance. The bridge plugin utilize Telegraf Consul plugin.

Prerequisites

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

Visit the Consul website for more information.

Configuration

The agent provides an example task file to help you get started quickly, but requires you to provide the correct settings for your Consul installation. To enable the task:

  1. Make a copy of the Consul example task file task-bridge-consul.yaml.example, renaming it to task-bridge-consul.yaml:

    On Windows, using Explorer or PowerShell:

    copy "C:\ProgramData\SolarWinds\Snap\tasks-autoload.d\task-bridge-consul.yaml.example" "C:\ProgramData\SolarWinds\Snap\tasks-autoload.d\task-bridge-consul.yaml"

    On Linux using command line:

    sudo cp -p /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-consul.yaml.example /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-consul.yaml
  2. Edit the task file with settings specific to your Consul install:

    If you wish to also collect logs for this service, uncomment the last section in the example task file. For more information on collecting logs, see Logs Collector/Forwarder.

    ---
    version: 2
    
    schedule:
      type: cron
      interval: "0 * * * * *"
    
    plugins:
      - plugin_name: bridge
    
        config:
          consul:
            ## Most of these values defaults to the one configured on a Consul's agent level.
            ## Optional Consul server address (default: "127.0.0.1:8500")
            # address: "127.0.0.1:8500"
            ## 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: "")
            # datacenter: ""
    
            ## Optional TLS Config
            # tls_ca: /path/to/cafile
            # tls_cert: /path/to/certfile
            # tls_key: /path/to/keyfile
            
            ## Use TLS but skip chain & host verification
            # insecure_skip_verify: true
    
            ## Consul checks' tag splitting
            # When tags are formatted like "key:value" with ":" as a delimiter then
            # they will be splitted and reported as proper key:value
            # tag_delimiter: ":"
    
        publish:
          - plugin_name: publisher-appoptics
    
    ## If you want to gather logs for this integration, uncomment the following section.
    #  - plugin_name: log-files
    #    config:
    #      file_paths:
    #        - /var/log/consul_server.log
    
    #    publish:
    #      - plugin_name: loggly-http-bulk
  3. Restart the agent:

    On Windows command line:

    net stop swisnapd
    net start swisnapd

    On Linux command line:

    sudo service swisnapd restart
  4. Enable the Consul integration in AppOptics

    On the Integrations Page you will see Consul integration available if the previous steps were successful. It may take a couple minutes before the Consul integration is identified. Select the Consul integration to open the configuration menu in the UI, and enable it. If you do not see it, see Troubleshooting Linux..

Testing Integration

To check if and what metrics can be collected with given configuration, run bridge plugin in debug mode:

On Windows command line:

"C:\Program Files\SolarWinds\Snap\bin\snap-plugin-collector-bridge.exe" --debug-mode --plugin-config "{\"consul\": {}}"

On Linux command line:

/opt/SolarWinds/Snap/bin/snap-plugin-collector-bridge --debug-mode --plugin-config "{\"consul\": {}}"

Metrics and Tags

Default Metrics

The Consul integration 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.

Navigation Notice: When the APM Integrated Experience is enabled, AppOptics shares a common navigation and enhanced feature set with other integrated experience products. How you navigate AppOptics and access its features may vary from these instructions.

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.