Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Is it possible to monitor Varnish running inside a Docker container?

varnish

#1
  • Which version of Windows or which distribution of Linux are you using?
    Ubuntu 16.04
  • What version of the Infrastructure agent are you using?
    1.7.6
  • What is your Infrastructure Subscription level? Essentials or PRO?
    Pro

I have the infrastructure agent running on a host VM which is also running Docker. Varnish is running inside a container. It seems like the varnish integration added to the host can’t monitor varnish running inside the container. Is there a way to make this work?

I thought about installing the infrastructure agent inside the varnish container but I don’t want the container to show up as another host. Plus the container doesn’t use a varnish.params file because the options are passed directly to the container via environment variables.

Are there any other options for sending varnish data to New Relic in this setup?

Thanks!


#2

Hello!

You should be able to monitor varnish from outside the docker environment on a host running infra and the integration. As long as the integration is able to access varnish, it should be able to pull data.


#3

Thanks for your help.

I guess that’s where I’m stuck. I have varnish running inside the container so I’m not sure how to get the integration on the host to use it. Here is what I’m getting from the service logs.

newrelic-infra-service[13444]: time=“2019-12-04T17:48:57Z” level=error msg=“Integration command failed” error=“exit status 1” instance=varnish_all integration=com.newrelic.varnish prefix=config/varnish stderr="[ERR] Error parsing params file : varnish.params file could not be found\n[ERR] Error collecting metrics: exec: “varnishstat”: executable file not found in $PATH\n" working-dir=/var/db/newrelic-infra/newrelic-integrations

So it seems like I need to overcome two problems.

  1. It can’t find varnish.params. I’m not using this in the container because I’m configuring varnish using environment variables that get interpreted into the container entrypoint. So the configuration is defined as command parameters. instead of in a varnish.params file.
  2. It can’t use varnishstat, which is inside the container. Do I need to volume mount this to the host?

#4

Hello @dbarbarisi,

The integration will definitely need to locate the varnish params file here. If the file location can be mounted so that the integration has access to it, then that should help.

We are a bit limited in our support here as this isn’t a supported implementation.