Ottomata has submitted this change and it was merged. Change subject: Use logster to parse varnishkafka logs and send to statsd ......................................................................
Use logster to parse varnishkafka logs and send to statsd This uses a local txstasd instance to cache and serialize the stats before sending to statsd on tungsten T76342 Change-Id: I6ef6412eddb2e9c4508d243b301b75d0d478961d --- M manifests/role/cache.pp 1 file changed, 40 insertions(+), 0 deletions(-) Approvals: Ottomata: Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp index 09137ae..313663a 100644 --- a/manifests/role/cache.pp +++ b/manifests/role/cache.pp @@ -379,6 +379,26 @@ } } + # == Class varnish::statsd + # Installs a local statsd instance for aggregating and serializing + # stats before sending them off to a remote statsd instance. + class varnish::statsd { + class { '::txstatsd': + settings => { + statsd => { + 'carbon-cache-host' => "graphite-in.eqiad.wmnet", + 'carbon-cache-port' => 2004, + 'listen-port' => 8125, + 'statsd-compliance' => 0, + 'prefix' => '', + 'max-queue-size' => 1000 * 1000, + 'max-datapoints-per-message' => 10 * 1000, + 'instance-name' => "statsd.${::hostname}", + }, + }, + } + } + # == Class varnish::kafka # Base class for instances of varnishkafka on cache servers. # @@ -425,6 +445,7 @@ 'cp3022' => 2000, default => 30000, } + varnishkafka::instance { 'webrequest': brokers => $kafka_brokers, topic => $topic, @@ -477,6 +498,25 @@ critical => '30.0', require => Varnishkafka::Monitor['webrequest'], } + + # test this on mobilesb before applying to all varnishes. + if ($topic == 'webrequest_mobile') { + # varnishkafka will use a local statsd instance for + # using logster to collect metrics. + # NOTE: This include will be moved into the parent + # varnish::kafka class once logster and local statsd + # are proven to work on mobiles. + include role::cache::varnish::statsd + + # Test using logster to send varnishkafka stats to statsd -> graphite. + # This may be moved into the varnishkafka module. + logster::job { 'varnishkafka-webrequest': + parser => 'JsonParser', + logfile => "/var/cache/varnishkafka/webrequest.stats.json", + logster_options => "--statsd-host=localhost:8125 --metric-prefix=varnishkafka.${::hostname}.webrequest", + require => Class['role::cache::varnish::statsd'], + } + } } # == Class varnish::kafka::statsv -- To view, visit https://gerrit.wikimedia.org/r/182072 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ef6412eddb2e9c4508d243b301b75d0d478961d Gerrit-PatchSet: 6 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata <o...@wikimedia.org> Gerrit-Reviewer: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org> Gerrit-Reviewer: Ottomata <o...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits