The Observability Blog

Categories:
  • Google Cloud
  • Metrics

How to Monitor Varnish with Google Cloud Platform

by Jonathan Wamsley on
July 13, 2022

We’re excited to announce that we’ve recently added Varnish monitoring support for Google Cloud Platform. You can check it out here!

Below are steps to get up and running quickly with observIQ’s Google Cloud Platform integrations, and monitor metrics and logs from Varnish in your Google Cloud Platform. You can check out Google’s documentation for using the Ops Agent for Varnish here: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/install-index

What signals matter?

Varnish is a popular content streaming technology. Important metrics include information from clients, performance, threads, and backend. 

  • Client Metrics
    • Connections
    • Requests
  • Performance Metrics
    • Cache Hits
    • Evictions
  • Thread Metrics
    • Creations
    • Failures
  • Backend Metrics
    • Success
    • Failures
    • General health

All of the above categories can be gathered with the Varnish receiver – so let’s get started.

Before you begin

If you don’t already have an Ops Agent with the latest Varnish receiver installed, you’ll need to do that first. Check out the Google Cloud Platform Ops Agent documentation for installation methods, including the one-line installer.

Configuring the Varnish receiver for Metrics and Logs

Navigate to your Ops Agent configuration file. You’ll find it in the following location: 

  •  /etc/google-cloud-ops-agent/config.yaml (Linux)

Edit the configuration file for Varnish metrics as shown below:

metrics:
  receivers:
    varnish:
      type: varnish
  service:
    pipelines:
      varnish:
        receivers:
          - varnish

For Logging, add the following in the same yaml config file:

logging:
  receivers:
    varnish:
      type: varnish
  service:
    pipelines:
      varnish:
        receivers:
          - varnish

Restart the Ops Agent with the following command:

sudo service google-cloud-ops-agent restart

sleep 30

Viewing the metrics collected

If you followed the steps detailed above, the following Varnish metrics will now be delivered to your preferred destination.

MetricDescription
varnish.backend.connection.count

The backend connection type count.

varnish.cache.operation.count

The cache operation type count.

varnish.thread.operation.count

The thread operation type count.

varnish.session.count

The session connection type count.

varnish.object.nuked

The objects that have been forcefully evicted from storage count.

varnish.object.moved

The moved operations done on the LRU list count.

varnish.object.expired

The expired objects from old age count.

varnish.object.count

The HTTP objects in the cache count.

varnish.client.request.count

The client request count.

varnish.client.request.error.count

The client request errors received by status code.

varnish.backend.request.count

The backend requests count.

Varnish is a high performance web application accelerator for caching requests and delivering content. observIQ’s monitoring technology is a game changer for organizations that care about performance and efficiency. If you’re using Varnish, our solutions can make a significant difference in your infrastructure monitoring. Follow this space to keep up with all our future posts and simplified configurations for various sources.

For questions, requests, and suggestions, reach out to our support team at support@observIQ.com or join us on Slack!