Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/89359
Change subject: Add varnish::logging::client_stats ...................................................................... Add varnish::logging::client_stats This patch provisions an additional varnishncsa instance on the bits varnishes, which filters for /stats?.* requests and logs them via UDP to hafnium. My intent is to use this end-point to send JavaScript profiling data. This data would be cached in localStorage on the client until a time / size threshold is met, at which point the stats will be serialized into a query string and transmitted in batch as a single request. With that in place, it will be possible to implement an interface much like wfProfileIn() / wfProfileOut() in PHP, which get sent from MediaWiki via UDP to Graphite. In the case of client-side metrics, a listener on hafnium will enforce throttling rules, split up query strings into individual stats, perform validation them, and send them to Graphite for plotting. Change-Id: I69ff99c9e342b2a58a8dddb661b20da46d219246 --- M manifests/role/cache.pp M templates/varnish/bits.inc.vcl.erb 2 files changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/59/89359/1 diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp index ac05df9..ffcb002 100644 --- a/manifests/role/cache.pp +++ b/manifests/role/cache.pp @@ -431,6 +431,27 @@ } } + + # == Class: varnish::logging::client_stats + # Beacon for collecting client-side profiling data. Unlike events, stats + # are not logged immediately, but saved into localStorage and transmitted + # in batches. + class varnish::logging::client_stats { + $stats_listener = $::realm ? { + labs => 'deployment-eventlogging.pmtpa.wmflabs', + default => 'hafnium.wikimedia.org', + } + + varnish::logging { 'client_stats' : + listener_address => $stats_listener, + port => '8490', + instance_name => '', + cli_args => '-m RxURL:^/stats\?. -D', + log_fmt => "%q\t%l\t%n\t%t\t%h", + monitor => false, + } + } + class varnish::logging::eventlistener { if $::realm == 'production' { $event_listener = $::site ? { @@ -917,6 +938,7 @@ } include role::cache::varnish::logging::eventlistener + include role::cache::varnish::logging::client_stats } class mobile inherits role::cache::varnish::2layer { diff --git a/templates/varnish/bits.inc.vcl.erb b/templates/varnish/bits.inc.vcl.erb index abbd7cf..9ee7023 100644 --- a/templates/varnish/bits.inc.vcl.erb +++ b/templates/varnish/bits.inc.vcl.erb @@ -8,7 +8,7 @@ error 403 "HTTP method not allowed."; } if (req.http.host == "<%= cluster_options.fetch( "bits_domain", "bits.wikimedia.org" )%>") { - if (req.url ~ "^/event\.gif") { + if (req.url ~ "^/event\.gif" || req.url ~ "^/stats\?") { error 204; } /* For https-only wikis, the redirect from http to https for bits assets should occur -- To view, visit https://gerrit.wikimedia.org/r/89359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I69ff99c9e342b2a58a8dddb661b20da46d219246 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ori.livneh <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits