Collectd: varnish plugin is incompatible with libvarnishapi 5.2

Created on 22 Oct 2017  路  7Comments  路  Source: collectd/collectd

The API and ABI of libvarnishapi have changed (once again, I believe). collectd fails to build with a couple of errors:

varnish.c: In function 'varnish_monitor':
varnish.c:143:13: error: 'const struct VSC_point' has no member named 'section'
   class = pt->section->fantom->type;
             ^~
varnish.c:144:14: error: 'const struct VSC_point' has no member named 'desc'; did you mean 'sdesc'?
   name = pt->desc->name;
              ^~~~
              sdesc
varnish.c: In function 'varnish_read':
varnish.c:988:6: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
   vd = VSM_New();
      ^
varnish.c:996:14: error: implicit declaration of function 'VSM_n_Arg'; did you mean 'VSM_Arg'? [-Werror=implicit-
function-declaration]
     status = VSM_n_Arg(vd, conf->instance);
              ^~~~~~~~~
              VSM_Arg
varnish.c:998:7: error: implicit declaration of function 'VSM_Delete'; did you mean 'VSM_Get'? [-Werror=implicit-
function-declaration]
       VSM_Delete(vd);
       ^~~~~~~~~~
       VSM_Get
varnish.c:1009:9: error: implicit declaration of function 'VSM_Open'; did you mean 'VSM_Get'? [-Werror=implicit-f
unction-declaration]
   ok = (VSM_Open(vd) == 0);
         ^~~~~~~~
         VSM_Get
varnish.c:1021:11: error: implicit declaration of function 'VSC_Main'; did you mean 'VSM_Map'? [-Werror=implicit-
function-declaration]
   stats = VSC_Main(vd, NULL);
           ^~~~~~~~
           VSM_Map
varnish.c:1021:9: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
   stats = VSC_Main(vd, NULL);
         ^
varnish.c:1033:12: error: passing argument 1 of 'VSC_Iter' from incompatible pointer type [-Werror=incompatible-pointer-types]
   VSC_Iter(vd, NULL, varnish_monitor, conf);
            ^~
In file included from varnish.c:32:0:
/usr/include/varnish/vapi/vsc.h:131:5: note: expected 'struct vsc *' but argument is of type 'struct VSM_data *'
 int VSC_Iter(struct vsc *, struct vsm *, VSC_iter_f *, void *priv);
     ^~~~~~~~
Feature request Pending contributor action

Most helpful comment

@tokkee: you are righ, the version handling in needs some updating.

As soon as my time allows, i'll have a patch which addresses:

  1. The varnish ABI versioning.
  2. How the collectd configure script figures out the varnish version
  3. The collectd varnish plugin compatibility with varnish-5.2
  4. Adding the new counters.

All 7 comments

Related, see also http://bugs.debian.org/879471

CC: @dmatetelki

I think the varnish plugin currently only supports versions 3 and 4.

@tokkee I assume the Debian package forcefully activated the plugin? Or is there something to be fixed in the configure script before this feature is implemented?

@octo, the configure script currently detects libvarnish as version 4. Since varnish upstream doesn't provide a good way to check the current version (based on only a quick search), the configure script basically needs to guess. So, configure and the plugin will require updates.

@tokkee: you are righ, the version handling in needs some updating.

As soon as my time allows, i'll have a patch which addresses:

  1. The varnish ABI versioning.
  2. How the collectd configure script figures out the varnish version
  3. The collectd varnish plugin compatibility with varnish-5.2
  4. Adding the new counters.

Here is a PR: #2525

I'll create another/update it with the counters new in 5.2

I think that you can close this issue

Closing as Varnish 5 support was removed in #3360

Was this page helpful?
0 / 5 - 0 ratings