Ottomata has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182072

Change subject: Use logster to parse varishkafka logs and send to statsd
......................................................................

Use logster to parse varishkafka logs and send to statsd

This uses a local txstasd instance to cache and serialize the stats before
sending to statsd on tungsten

Change-Id: I6ef6412eddb2e9c4508d243b301b75d0d478961d
---
M manifests/role/cache.pp
1 file changed, 34 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/72/182072/1

diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index 09137ae..a374c29 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.
     #
@@ -398,6 +418,10 @@
         # so that logs will go to rsyslog the first time puppet
         # sets up varnishkafka.
         Rsyslog::Conf['varnishkafka'] -> Varnishkafka::Instance <|  |>
+
+        # varnishkafka will use a local statsd instance for
+        # using logster to collect metrics.
+        include role::cache::varnish::statsd
     }
 
     # == Class varnish::kafka::webrequest
@@ -425,6 +449,7 @@
             'cp3022' => 2000,
             default  => 30000,
         }
+
         varnishkafka::instance { 'webrequest':
             brokers                      => $kafka_brokers,
             topic                        => $topic,
@@ -477,6 +502,15 @@
             critical    => '30.0',
             require     => Varnishkafka::Monitor['webrequest'],
         }
+
+        # 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=statsd.${::hostname}: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: newchange
Gerrit-Change-Id: I6ef6412eddb2e9c4508d243b301b75d0d478961d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to