Varnish - Monitoring Extension

Varnish Monitoring Extension


This extension works only with the standalone machine agent.


Use Case


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.




   1. vagent2 (open source project on GitHub) needs to be installed. Please follow the steps in /vagent2/blob/master/INSTALL.rst to install vagent2. You can also install vagent2 from the attached binary file.

   2. Download and install the VarnishMonitor zip file into the <machineagent install dir>/monitors/ directory.

   3. Open <machineagent install dir>/monitors/VarnishMonitor/monitor.xml and configure the Varnish parameters.


     <argument name="host" is-required="true" default-value="localhost"/>
     <argument name="port" is-required="true" default-value="6085"/>
     <argument name="username" is-required="true" default-value="username"/>
     <argument name="password" is-required="true" default-value="password"/>
     <argument name="enabled-metrics-path" is-required="true" default-value="monitors/VarnishMonitor/conf/EnabledMetrics.xml"/>

  4. Open <machineagent install dir>/monitors/VarnishMonitor/conf/EnabledMetrics.xml and configure the list of enabled metrics. Here is a sample configuration of the enabled metrics:


     <Metric name="mem_free"/>
     <Metric name="mem_total"/>

   5. Restart the machine agent.

   6. In the AppDynamics Metric Browser, look for: Application Infrastructure Performance | <Tier> | Custom Metrics | Varnish




NOTE: By default, only the following metrics are reported. To change the metrics that are reported, edit the EnabledMetrics.xml file. (You can see the full list of supported metrics on the GitHub site.)


Metric NameDescription
client_connClient connections accepted
client_dropConnection dropped, no sess/wrk
client_reqClient requests received
cache_hitCache hits
cache_hitpassCache hits for pass
cache_missCache misses
backend_connBackend conn. success
backend_unhealthyBackend conn. not attempted
backend_busyBackend conn. too many
backend_failBackend conn. failures
backend_reuseBackend conn. reuses
backend_toolateBackend connection was closed
backend_recycleBackend connnection recycles
backend_retryBackend connection retry
n_wrkN worker threads
n_wrk_createN worker threads created
n_wrk_failedN worker threads not created
n_wrk_maxN worker threads limited
n_wrk_lqueuework request queue length
n_wrk_queuedN queued work requests
n_wrk_dropN dropped work requests
n_backendN backends
n_expiredN expired objects
s_sessTotal Sessions
s_reqTotal Requests
uptimeClient uptime
dir_dns_lookupsDNS director lookups
dir_dns_failedDNS director failed lookups
dir_dns_hitDNS director cached lookups hit
dir_dns_cache_fullDNS director full dnscache


Custom Dashboard





Always feel free to fork and contribute any changes directly via GitHub.



For any support questions, please






Last Update: