<div dir="ltr">You can do this in a VMOD via PRIV_TASK:<div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<br>Reza Naghibi<br>Varnish Software</div></div></div>
<br><div class="gmail_quote">On Fri, May 5, 2017 at 10:15 PM, Ryan Burn <span dir="ltr"><<a href="mailto:rnickb731@gmail.com" target="_blank">rnickb731@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
>From VCL, is it possible to execute code that runs after a request has<br>
been processed?<br>
<br>
I'm looking into writing a module that enables Varnish for distributed<br>
tracing using the OpenTracing project [<a href="http://opentracing.io" rel="noreferrer" target="_blank">opentracing.io</a>]. This requires<br>
invoking code at the beginning of a request to start a span and insert<br>
tracing context into the request's headers and invoking code after a<br>
request's been processed to finish the span and measure how long it<br>
took to process.<br>
<br>
I recently did a similar project for nginx<br>
[<a href="http://github.com/rnburn/nginx-opentracing" rel="noreferrer" target="_blank">github.com/rnburn/nginx-<wbr>opentracing</a>]. Nginx provides an<br>
NGX_HTTP_LOG_PHASE [<a href="http://www.nginxguts.com/2011/01/phases/" rel="noreferrer" target="_blank">www.nginxguts.com/2011/01/<wbr>phases/</a>] that allows you<br>
to set up handlers run after requests are serviced. Can anything<br>
equivalent be done using VCL?<br>
<br>
I image you could accomplish this by subscribing and regularly reading<br>
from Varnish's shared memory log, but I'd much rather do it directly<br>
if possible.<br>
<br>
Thanks, Ryan<br>
<br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
</blockquote></div><br></div>