Varnish HTTP 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. If Varnish is installed on your environment, the Sysdig agent will automatically connect. See the Default Configuration section, below.
The Sysdig Agent automatically collects all metrics. You can also edit the configuration to emit service checks for the back end.
This page describes the default configuration settings, how to edit the configuration to collect additional information, the metrics available for integration, and a sample result in the Sysdig Monitor UI.
Varnish will automatically expose all metrics. You do not need to add anything to the Varnish instance.
Sysdig Agent Configuration
Review how to Edit dragent.yaml to Integrate or Modify Application Checks.
By default, Sysdig’s
dragent.default.yaml uses the following code to
connect with Varnish and collect all but the VBE metrics. See Example 2
Enable Varnish VBE
metrics_filter: - exclude: varnish.VBE.* app_checks: - name: varnishapp_checks: interval: 15 pattern: comm: varnishd conf: varnishstat: /usr/bin/varnishstat
Optionally, if you want to submit service checks for the health of each
back end, you can configure
varnishadm and edit
dragent.yaml as in
Remember! Never edit
dragent.default.yaml directly; always edit
Example 1 Service Health Checks with varnishadm
varnishadm is configured, the Sysdig agent requires privileges to
execute the binary with root privileges. Add the following to your
sysdig-agent ALL=(ALL) NOPASSWD:/usr/bin/varnishadm
dragent.yaml as follows. Note: If you have configured
varnishadm and your secret file is NOT
/etc/varnish/secret, you can
app_checks: - name: varnish interval: 15 pattern: comm: varnishd conf: varnishstat: /usr/bin/varnishstat varnishadm: /usr/bin/varnishadm secretfile: /etc/varnish/secret
This example will enable following service check.
varnish.backend_healthy: The agent submits a service check for each
Varnish backend, tagging each with
Example 2 Enable Varnish VBE Metrics
Varnish VBE metrics are dynamically generated (and therefore are not
listed in the Metrics
Dictionary). Because they
generate unique metric names with timestamps, they can clutter metric
handling and are filtered out by default. If you want to collect these
include in the
metrics_filter: - include: varnish.VBE.* app_checks: - name: varnishapp_checks: interval: 15 pattern: comm: varnishd conf: varnishstat: /usr/bin/varnishstat
See Varnish Metrics.
Result in the Monitor UI
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.