Ottomata has submitted this change and it was merged.

Change subject: Deploy VarnishReqstats diamond collector on remaining cache 
hosts
......................................................................


Deploy VarnishReqstats diamond collector on remaining cache hosts

Also add ensure parameter to varnish::monitoring::varnishreqstats

Bug: T83580
Change-Id: Ied283ac8d40bde07d37add59aecc6aee7548b267
---
M modules/role/manifests/cache/maps.pp
M modules/role/manifests/cache/misc.pp
M modules/role/manifests/cache/mobile.pp
M modules/role/manifests/cache/parsoid.pp
M modules/role/manifests/cache/text.pp
M modules/role/manifests/cache/upload.pp
M modules/varnish/manifests/monitoring/varnishreqstats.pp
7 files changed, 30 insertions(+), 6 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved



diff --git a/modules/role/manifests/cache/maps.pp 
b/modules/role/manifests/cache/maps.pp
index dfe47ce..ccd2985 100644
--- a/modules/role/manifests/cache/maps.pp
+++ b/modules/role/manifests/cache/maps.pp
@@ -114,4 +114,11 @@
             topic => 'webrequest_maps',
         }
     }
+
+    # Parse varnishlogs for request statistics and send to statsd via diamond.
+    varnish::monitoring::varnishreqstats { 'MapsFrontend':
+        instance_name => 'frontend',
+        metric_path   => "varnish.${::site}.maps.frontend.request",
+        require       => Varnish::Instance['maps-frontend'],
+    }
 }
diff --git a/modules/role/manifests/cache/misc.pp 
b/modules/role/manifests/cache/misc.pp
index ab54bb5..b0d1e8c 100644
--- a/modules/role/manifests/cache/misc.pp
+++ b/modules/role/manifests/cache/misc.pp
@@ -202,4 +202,11 @@
             varnish_svc_name => 'varnish',
         }
     }
+
+    # Parse varnishlogs for request statistics and send to statsd via diamond.
+    varnish::monitoring::varnishreqstats { 'MiscFrontend':
+        instance_name => 'frontend',
+        metric_path   => "varnish.${::site}.misc.frontend.request",
+        require       => Varnish::Instance['misc'],
+    }
 }
diff --git a/modules/role/manifests/cache/mobile.pp 
b/modules/role/manifests/cache/mobile.pp
index ed5975e..1caff9b 100644
--- a/modules/role/manifests/cache/mobile.pp
+++ b/modules/role/manifests/cache/mobile.pp
@@ -192,5 +192,6 @@
     varnish::monitoring::varnishreqstats { 'MobileFrontend':
         instance_name => 'frontend',
         metric_path   => "varnish.${::site}.mobile.frontend.request",
+        require       => Varnish::Instance['mobile-frontend'],
     }
 }
diff --git a/modules/role/manifests/cache/parsoid.pp 
b/modules/role/manifests/cache/parsoid.pp
index 8155501..131e144 100644
--- a/modules/role/manifests/cache/parsoid.pp
+++ b/modules/role/manifests/cache/parsoid.pp
@@ -145,4 +145,11 @@
             },
         ]),
     }
+
+    # Parse varnishlogs for request statistics and send to statsd via diamond.
+    varnish::monitoring::varnishreqstats { 'ParsoidFrontend':
+        instance_name => 'frontend',
+        metric_path   => "varnish.${::site}.parsoid.frontend.request",
+        require       => Varnish::Instance['parsoid-frontend'],
+    }
 }
diff --git a/modules/role/manifests/cache/text.pp 
b/modules/role/manifests/cache/text.pp
index c70a1eb..8da1971 100644
--- a/modules/role/manifests/cache/text.pp
+++ b/modules/role/manifests/cache/text.pp
@@ -189,11 +189,10 @@
         class { 'role::cache::kafka::webrequest': topic => 'webrequest_text' }
     }
 
-    # Test rollout of varnish reqstats diamond collector.
-    if $::hostname == 'cp1052' {
-        varnish::monitoring::varnishreqstats { 'TextFrontend':
-            instance_name => 'frontend',
-            metric_path   => "varnish.${::site}.text.frontend.request",
-        }
+    # Parse varnishlogs for request statistics and send to statsd via diamond.
+    varnish::monitoring::varnishreqstats { 'TextFrontend':
+        instance_name => 'frontend',
+        metric_path   => "varnish.${::site}.text.frontend.request",
+        require       => Varnish::Instance['text-frontend'],
     }
 }
diff --git a/modules/role/manifests/cache/upload.pp 
b/modules/role/manifests/cache/upload.pp
index 0580e67..c75cea5 100644
--- a/modules/role/manifests/cache/upload.pp
+++ b/modules/role/manifests/cache/upload.pp
@@ -144,5 +144,6 @@
     varnish::monitoring::varnishreqstats { 'UploadFrontend':
         instance_name => 'frontend',
         metric_path   => "varnish.${::site}.upload.frontend.request",
+        require       => Varnish::Instance['upload-frontend'],
     }
 }
diff --git a/modules/varnish/manifests/monitoring/varnishreqstats.pp 
b/modules/varnish/manifests/monitoring/varnishreqstats.pp
index 6212045..fad253b 100644
--- a/modules/varnish/manifests/monitoring/varnishreqstats.pp
+++ b/modules/varnish/manifests/monitoring/varnishreqstats.pp
@@ -16,11 +16,13 @@
 define varnish::monitoring::varnishreqstats(
     $instance_name = $name,
     $metric_path   = "varnish.${::site}.${name}.request",
+    $ensure        = 'present',
 ) {
     # ${collector_name}Collector will be used as the python diamond collector 
class name
     # when varnishreqstats-diamond.py.erb is rendered.
     $collector_name = "Varnishreqstats${name}"
     diamond::collector { $collector_name:
+        ensure   => $ensure,
         content  => template('varnish/varnishreqstats-diamond.py.erb'),
         settings => {
             'varnish_name' => $instance_name,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied283ac8d40bde07d37add59aecc6aee7548b267
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to