Any way to invoke code from VCL after a request has been serviced?

Reza Naghibi reza at
Mon May 8 17:10:23 CEST 2017

You can do this in a VMOD via PRIV_TASK:

Reza Naghibi
Varnish Software

On Fri, May 5, 2017 at 10:15 PM, Ryan Burn <rnickb731 at> wrote:

> Hello,
> From VCL, is it possible to execute code that runs after a request has
> been processed?
> I'm looking into writing a module that enables Varnish for distributed
> tracing using the OpenTracing project []. This requires
> invoking code at the beginning of a request to start a span and insert
> tracing context into the request's headers and invoking code after a
> request's been processed to finish the span and measure how long it
> took to process.
> I recently did a similar project for nginx
> []. Nginx provides an
> NGX_HTTP_LOG_PHASE [] that allows you
> to set up handlers run after requests are serviced. Can anything
> equivalent be done using VCL?
> I image you could accomplish this by subscribing and regularly reading
> from Varnish's shared memory log, but I'd much rather do it directly
> if possible.
> Thanks, Ryan
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list