Mwalker has uploaded a new change for review.

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

Change subject: Allowing a configurable StatsD server
......................................................................

Allowing a configurable StatsD server

Arguably this should be in some sort of configuration file
that's not in puppet. But right now that's not quite possible
unless I start introducing the concept of realms into my
versioned config file.

Change-Id: Ib787062bbba93d3fba98f1c51d605548d473eeb0
---
M manifests/role/ocg.pp
M modules/ocg/manifests/init.pp
M modules/ocg/templates/mw-ocg-service.js.erb
3 files changed, 26 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/78/137278/1

diff --git a/manifests/role/ocg.pp b/manifests/role/ocg.pp
index 2d6d2ff..4cdfda6 100644
--- a/manifests/role/ocg.pp
+++ b/manifests/role/ocg.pp
@@ -18,12 +18,21 @@
         # Default host in the WMF production env... this needs a variable or 
something
         $redis_host = 'rdb1002.eqiad.wmnet'
     }
+    
+    if ( $::ocg_statsd_server_override != undef ) {
+        $statsd_host = $::ocg_statsd_server_override
+    } else {
+        # Default host in the WMF production env
+        $statsd_host = 'statsd.eqiad.wmnet'
+    }
 
     class { '::ocg':
-        redis_host      => $redis_host,
-        redis_password  => $passwords::redis::main_password,
-        temp_dir        => '/srv/deployment/ocg/tmp',
-        service_port    => $service_port
+        redis_host         => $redis_host,
+        redis_password     => $passwords::redis::main_password,
+        temp_dir           => '/srv/deployment/ocg/tmp',
+        service_port       => $service_port,
+        statsd_server      => $statsd_host,
+        statsd_is_txstatsd => 1
     }
 
     ferm::service { 'ocg-http':
@@ -47,10 +56,12 @@
     $service_port = 8000
 
     class { '::ocg':
-        redis_host      => 'localhost',
-        redis_password  => $passwords::redis::ocg_test_password,
-        temp_dir        => '/srv/deployment/ocg/tmp',
-        service_port    => $service_port
+        redis_host         => 'localhost',
+        redis_password     => $passwords::redis::ocg_test_password,
+        temp_dir           => '/srv/deployment/ocg/tmp',
+        service_port       => $service_port,
+        statsd_host        => 'statsd.eqiad.wmnet',
+        statsd_is_txstatsd => 1
     }
 
     ferm::service { 'ocg-http':
diff --git a/modules/ocg/manifests/init.pp b/modules/ocg/manifests/init.pp
index b472c56..8c771aa 100644
--- a/modules/ocg/manifests/init.pp
+++ b/modules/ocg/manifests/init.pp
@@ -16,6 +16,9 @@
     $redis_host = 'localhost',
     $redis_port = 6379,
     $redis_password = '',
+    $statsd_host = 'localhost',
+    $statsd_port = 8125,
+    $statsd_is_txstatsd = 0,
     $temp_dir = '/srv/deployment/ocg/tmp'
 ) {
     deployment::target { 'ocg': }
diff --git a/modules/ocg/templates/mw-ocg-service.js.erb 
b/modules/ocg/templates/mw-ocg-service.js.erb
index 6aa2e29..554912f 100644
--- a/modules/ocg/templates/mw-ocg-service.js.erb
+++ b/modules/ocg/templates/mw-ocg-service.js.erb
@@ -16,6 +16,10 @@
 
        config.frontend.port = <%= @service_port %>;
        config.backend.temp_dir = "<%= @temp_dir %>";
+       
+       config.reporting.statsd_server = "<%= @statsd_host %>";
+       config.reporting.statsd_port = <%= @statsd_port %>;
+       config.reporting.is_txstatsd = <%= @statsd_is_txstatsd %>;
 
        // Import the public local settings
        return require("/srv/deployment/ocg/ocg/LocalSettings.js")(config)

-- 
To view, visit https://gerrit.wikimedia.org/r/137278
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib787062bbba93d3fba98f1c51d605548d473eeb0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mwalker <mwal...@wikimedia.org>

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

Reply via email to