Consul
Monitor Consul with AppDynamics CNS
This page describes the process to monitor Consul telemetry data with the Consul monitoring extension for AppDynamics CNS.
Introduction
Consul produces a range of metrics in various formats that reflect the health and stability of a datacenter and can help diagnose or predict potential issues.
AppDynamics CNS can collect Consul telemetry data and node information using the HashiCorp Consul Monitoring Extension. The extension provides you with two example dashboards that can be imported into your AppDynamics controller. To use the extension, nodes with Consul agents need the AppDynamics Machine Agent installed, and the system must meet the AppDynamics system requirements. AppDynamics SaaS or On-Prem controller version 4.5 or greater is also required.
Workflow
- Install AppDynamics Machine Agent including the JRE on the Consul nodes.
- Install HashiCorp Consul Monitoring Extension for AppDynamics CNS.
- Configure Consul to send telemetry data to the AppDynamics agent.
Install AppDynamics Machine Agent bundle
First, you must install and configure the AppDynamics Machine Agent on your Consul nodes. An official installation guide is available in the AppDynamics documentation.
After you install the Machine Agent, configure it to communicate with the controller when running in standalone mode. This process requires you to edit the controller file /appdynamics/machine-agent/conf/controller-info.xml with your AppDynamics Controller access information. For more information and a configuration reference, refer to the external AppDynamics documentation to configure the Standalone Machine Agent.
We also recommend that you increase the value of the maxMetrics variable so that metric data is not truncated. The default location of the service definition file is /etc/systemd/system/appdynamics-machine-agent.service. The following example command increases the default value to 10,000.
$ sed -i 's/#Environment="JAVA_OPTS=-D<sys-property1>=<value1> -D<sys-property2>=<value2>"/Environment="JAVA_OPTS=-Dappdynamics.agent.maxMetrics=10000"/g' /etc/systemd/system/appdynamics-machine-agent.service
Install AppDynamics machine agent for Consul telemetry and statsite
After you configure the agent to communicate with the controller, configure the AppDynamics machine agent to generate telemetry data for Consul.
From the consul-appd-extension repository, copy the folder statsite into /opt/appdynamics/machine-agent/monitors/.
This extension uses statsite to import statsd Consul metrics into AppDynamics. Place the statsite executable into the /opt/appdynamics/machine-agent/monitors/statsite folder for every node you want to monitor. For more information about installing statsite, refer to the official statsite installation guide.
Configure Consul to send metrics to statsite
To configure your Consul agents to use statsite to send their telemetry data to AppDynamics CNS, add the following configuration to your Consul agent configuration file.
consul-statsite.hcl
telemetry {
dogstatsd_addr = "localhost:8125"
}
Explore telemetry metrics
For a complete list of Consul metrics supported by these integrations, as well as details on what each metric means, consult the Consul telemetry documentation.
All metrics reported by the extension will be available in the Metric Browser at Controller > Applications > Application > Metric Browser.
Application Infrastructure Performance > Consul > Custom Metrics > statsd > consul lists the available Consul metrics
Application Infrastructure Performance > Consul > Custom Metrics > statsd > envoy lists metrics available for the Connect service mesh.
Custom dashboard
The consul-appd-extension repository provides two custom dashboards to get you started with monitoring Consul. They are JSON files located in the dashboards folder.
To use them, change the value for the key applicationName within the templates to match your application name. Then import these dashboards into your AppDynamics controller from Dashboards & Reports tab > Dashboards > Import. After you import them, the dashboards are available in the Dashboard & Reports tab.


Custom health rules
AppDynamics CNS provides the ability to customize health rules, which are the policy statements that define event triggers. For Consul, you can create health rules for the applications that are using its service discovery and service mesh so that the metrics for both the application and Consul can appear in AppDynamics. For more information about creating custom health rules, refer to the AppDynamics documentation on defining custom metrics.
Next steps
For more information about personalizing your dashboards, refer to creating custom dashboards in the AppDynamics documentation.