Ottomata has uploaded a new change for review.

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


Change subject: Writing Kafka stats to jmxtrans outfile at 
/var/log/kafka/kafka-jmx.log
......................................................................

Writing Kafka stats to jmxtrans outfile at /var/log/kafka/kafka-jmx.log

Also installing logrotate.d conf file to rotate this file if it gets large.

Change-Id: I2d564e953416e91763b926b7a16e4c14a0093a35
---
M manifests/role/analytics/kafka.pp
1 file changed, 26 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/93897/1

diff --git a/manifests/role/analytics/kafka.pp 
b/manifests/role/analytics/kafka.pp
index cda5414..fe46833 100644
--- a/manifests/role/analytics/kafka.pp
+++ b/manifests/role/analytics/kafka.pp
@@ -106,9 +106,33 @@
         zookeeper_chroot    => $zookeeper_chroot,
     }
 
-    # Include the Kafka Server Jmxtrans instance
-    # to send Kafka Broker metrics to Ganglia
+    $jmxtrans_outfile = '/var/log/kafka/kafka-jmx.log'
+    file { $jmxtrans_outfile:
+        ensure  => 'present',
+        owner   => 'jmxtrans',
+        group   => 'jmxtrans',
+        mode    => '0644',
+        require => [Package['jmxtrans'], Package['kafka']]
+    }
+
+    # Include Kafka Server Jmxtrans class
+    # to send Kafka Broker metrics to Ganglia.
+    # We also save metrics to an logfile for easy
+    # debugging.
     class { '::kafka::server::jmxtrans':
         ganglia => "${ganglia_host}:${ganglia_port}",
+        outfile => $jmxtrans_outfile
+    }
+
+    # Install a logrotate.d file for the jmx.log file
+    file { '/etc/logrotate.d/kafka-jmx':
+        content =>
+"${jmxtrans_outfile} {
+    size 100M
+    rotate 2
+    missingok
+    create 0644 jmxtrans jmxtrans
+}
+"
     }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d564e953416e91763b926b7a16e4c14a0093a35
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>

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

Reply via email to