This extension works only with the standalone machine agent.
Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. The varnish-monitoring-extension gathers cache metrics exposed through Varnish's REST API and sends them to the AppDynamics Metric Browser.
Before the extension is installed, the prerequisites mentioned here need to be met. Please do not proceed with the extension installation if the specified prerequisites are not met.
This extension requires vagent2 to be installed. Please follow the steps in https://github.com/varnish/vagent2/blob/master/INSTALL.rst to install vagent2. You can also install vagent2 from the attached binary file.
1. Download and Unzip the VarnishMonitor zip file into the <machineagent install dir>/monitors/ directory.
2. Edit the file config.yml located at
<MachineAgent_Dir>/monitors/ The metricPrefix of the extension has to be configured as specified here. Please make sure that the right metricPrefix is chosen based on your machine agent deployment, otherwise this could lead to metrics not being visible in the controller.
3. Configure vagent2 details in <machineagent install dir>/monitors/VarnishMonitor/config.yml.
4. Open <machineagent install dir>/monitors/VarnishMonitor/EnabledMetrics.xml and configure the list of enabled metrics.
5. Restart the machine agent.
6. In the AppDynamics Metric Browser, look for: Application Infrastructure Performance | <Tier> | Custom Metrics | Varnish
Note : Please make sure to not use tab (\t) while editing yaml files. You may want to validate the yaml file using a yaml validator
1. Configure the Varnish Vagent2 details by editing the config.yml file in
2. Below is the default config.yml
varnish: - name: "LocalVarnish" host: "localhost" port: 6085 scheme: "http" username: "admin" # Provide either password or passwordEncrypted and encryptionKey password: "admin" passwordEncrypted: "" encryptionKey: "" enabledMetricsPath: "monitors/VarnishMonitor/EnabledMetrics.xml" proxyConfig: uri: username: password: - name: "RemoteVarnish" host: "localhost" port: 6085 scheme: "http" username: "admin" password: "admin" passwordEncrypted: "" encryptionKey: "" enabledMetricsPath: "monitors/VarnishMonitor/EnabledMetrics.xml" proxyConfig: uri: username: password: # Number of concurrent threads for # dealing with multiple Varnish instances # Note: You don't necessarily have to match the no of threads # to the no of Varnish instances configured above # unless you have a lot of CPUs in your machine numberOfVarnishThreads: 2 #This will create this metric in all the tiers, under this path metricPrefix: "Custom Metrics|Varnish|" #This will create it in specific Tier/Component. Make sure to replace
with the appropriate one from your environment. #To find the in your environment, please follow the screenshot https://docs.appdynamics.com/display/PRO42/Build+a+Monitoring+Extension+Using+Java #metricPrefix: Server|Component: |Custom Metrics|Varnish
3. Default EnabledMetrics.xml
<!-- Only metrics present here will be shown in the Controller. Remaining metrics will be ignored --> <EnabledMetrics> <Metric name="timestamp"/> <Metric name="MAIN.uptime" displayName="Uptime"/> <Metric name="MAIN.pools" collectDelta="true" displayName="No Of Pools"/> <Metric name="MAIN.threads" collectDelta="true"/> <Metric name="MAIN.threads_created" collectDelta="true"/> <Metric name="MAIN.n_backend"/> <Metric name="MAIN.shm_records"/> <Metric name="MAIN.shm_writes"/> <Metric name="MAIN.n_vcl"/> <Metric name="MAIN.n_vcl_avail"/> <Metric name="MAIN.bans"/> <Metric name="MAIN.bans_completed"/> <Metric name="MAIN.bans_added"/> <Metric name="MAIN.bans_persisted_bytes"/> <Metric name="MAIN.vsm_free"/> <Metric name="MAIN.vsm_used"/> <Metric name="MGT.uptime"/> <Metric name="MGT.child_start"/> <Metric name="MEMPOOL.busyobj.pool"/> <Metric name="MEMPOOL.busyobj.sz_wanted"/> <Metric name="MEMPOOL.busyobj.sz_actual"/> <Metric name="MEMPOOL.req0.pool"/> <Metric name="MEMPOOL.req0.sz_wanted"/> <Metric name="MEMPOOL.req0.sz_actual"/> </EnabledMetrics>
To avoid setting the clear text password in the config.yaml, please follow the process below to encrypt the password
1. Download the util jar to encrypt the password from https://github.com/Appdynamics/maven-repo/blob/master/releases/com/appdynamics/appd-exts-commons/1.1.2/appd-exts-commons-1.1.2.jar and navigate to the downloaded directory
2. Encrypt password from the commandline java -cp appd-exts-commons-1.1.2.jar com.appdynamics.extensions.crypto.Encryptor encryptionKey myPassword
3. Specify the passwordEncrypted and encryptionKey in config.yaml
NOTE: Only metrics configured in the EnabledMetrics.xml file will be collected. Please add the metrics you want to collect to this file.
Here are some of the varnish metrics available through vagent2.
|client_conn||Client connections accepted|
|client_drop||Connection dropped, no sess/wrk|
|client_req||Client requests received|
|cache_hitpass||Cache hits for pass|
|backend_conn||Backend conn. success|
|backend_unhealthy||Backend conn. not attempted|
|backend_busy||Backend conn. too many|
|backend_fail||Backend conn. failures|
|backend_reuse||Backend conn. reuses|
|backend_toolate||Backend connection was closed|
|backend_recycle||Backend connnection recycles|
|backend_retry||Backend connection retry|
|n_wrk||N worker threads|
|n_wrk_create||N worker threads created|
|n_wrk_failed||N worker threads not created|
|n_wrk_max||N worker threads limited|
|n_wrk_lqueue||work request queue length|
|n_wrk_queued||N queued work requests|
|n_wrk_drop||N dropped work requests|
|n_expired||N expired objects|
|dir_dns_lookups||DNS director lookups|
|dir_dns_failed||DNS director failed lookups|
|dir_dns_hit||DNS director cached lookups hit|
|dir_dns_cache_full||DNS director full dnscache|
Please look at the troubleshooting document and make sure that everything is followed correctly.
If after going through the Troubleshooting Document you have not been able to get your extension working, please file a ticket and add the following information.
Please provide the following in order for us to assist you better.
1. Stop the running machine agent. 2. Delete all existing logs under <MachineAgent>/logs. 3. Please enable debug logging by editing the file <MachineAgent>/conf/logging/log4j.xml. Change the level value of the following <logger> elements to debug. <logger name="com.singularity"> <logger name="com.appdynamics"> 4. Start the machine agent and please let it run for 10 mins. Then zip and upload all the logs in the directory <MachineAgent>/logs/*. 5. Attach the zipped <MachineAgent>/conf/* directory here. 6. Attach the zipped <MachineAgent>/monitors/ExtensionFolderYouAreHavingIssuesWith directory here.
Always feel free to fork and contribute any changes directly via GitHub.
For any support questions, please firstname.lastname@example.org.