-
-
Save nesquena/3792230 to your computer and use it in GitHub Desktop.
Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish. - Fixed for Varnish 3.0.2-1 on Ubuntu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Varnish NewRelic Tracking | |
# https://gist.github.com/2820068 | |
C{ | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
}C | |
sub vcl_recv { | |
C{ | |
#include </etc/varnish/newrelic.h> | |
}C | |
# ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish. | |
* | |
*/ | |
struct timeval detail_time; | |
gettimeofday(&detail_time, 0); | |
char start[20]; | |
sprintf(start, "t=%lu%06lu", detail_time.tv_sec, detail_time.tv_usec); | |
VRT_SetHdr(sp, HDR_REQ, "\020X-Request-Start:", start, vrt_magic_string_end); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment