Ottomata has submitted this change and it was merged.

Change subject: Adding kafka::server::jmxtrans support for jmxtrans Kafka 
broker metrics
......................................................................


Adding kafka::server::jmxtrans support for jmxtrans Kafka broker metrics

Change-Id: I0896eed96492efb1da438d1a260f14aa9dab9bc3
---
A manifests/server/jmxtrans.pp
1 file changed, 126 insertions(+), 0 deletions(-)

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



diff --git a/manifests/server/jmxtrans.pp b/manifests/server/jmxtrans.pp
new file mode 100644
index 0000000..caead6c
--- /dev/null
+++ b/manifests/server/jmxtrans.pp
@@ -0,0 +1,126 @@
+# == Class kafka::server::jmxtrans
+# Sets up a jmxtrans instance for a Kafka Server Broker.
+# this requires the jmxtrans puppet module found at
+# https://github.com/wikimedia/puppet-jmxtrans.
+#
+# == Parameters
+# $jmx_port      - Kafka JMX port
+# $ganglia       - Ganglia host:port
+# $graphite      - Graphite host:port
+# $outfile       - outfile to which Kafka stats will be written.
+#
+# == Usage
+# class { 'kafka::server::jmxtrans':
+#     ganglia => 'ganglia.example.org:8649'
+# }
+#
+class kafka::server::jmxtrans(
+    $jmx_port    = $kafka::defaults::jmx_port,
+    $ganglia     = undef,
+    $graphite    = undef,
+    $outfile     = undef,
+) inherits kafka::defaults
+{
+    $jmx = "${::fqdn}:${jmx_port}"
+
+    # query for metrics from Kafka's JVM
+    jmxtrans::metrics::jvm { $jmx:
+        outfile              => $outfile,
+        ganglia              => $ganglia,
+        graphite             => $graphite,
+    }
+
+    # query kafka for jmx metrics
+    jmxtrans::metrics { "kafka-${::hostname}-${jmx_port}":
+        jmx                  => $jmx,
+        outfile              => $outfile,
+        ganglia              => $ganglia,
+        ganglia_group_name   => 'kafka',
+        graphite             => $graphite,
+        graphite_root_prefix => 'kafka',
+        objects              => [
+            {
+                'name'          => 
'kafka.log:type=LogFlushStats,name=LogFlushRateAndTimeMs',
+                'attrs'         => {
+                    'Count' => { 'units' => 'flushes',   'slope' => 'both' },
+                },
+            },
+            {
+                'name'          => 
'kafka.server:type=kafka.BrokerTopicMetrics,name=*',
+                'typeNames'     => ['name'],
+                'attrs'         => {
+                    'Count' => { 'slope' => 'both' },
+                },
+            },
+            {
+                  'name'        => 
'kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions',
+                  'attrs'       => {
+                      'Value' => { 'units' => 'partitions', 'slope' => 'both' 
},
+                  },
+            },
+            {
+                  'name'         => 
'kafka.server:type=ReplicaManager,name=PartitionCount',
+                  'attrs'        => {
+                      'Value' => { 'units' => 'partitions', 'slope' => 'both' 
},
+                  },
+            },
+            {
+                  'name'        => 
'kafka.server:type=ReplicaManager,name=LeaderCount',
+                  'attrs'       => {
+                      'Value' => { 'units' => 'leaders', 'slope' => 'both' },
+                  },
+            },
+            {
+                  'name'        => 
'kafka.server:type=ReplicaManager,name=ISRShrinksPerSec',
+                  'attrs'       => {
+                      'Count' => { 'units' => 'shrinks', 'slope' => 'both' },
+                  },
+            },
+            {
+                  'name'        => 
'kafka.server:type=ReplicaManager,name=IsrExpandsPerSec',
+                  'attrs'       => {
+                      'Count' => { 'units' => 'expands', 'slope' => 'both' },
+                  },
+            },
+            {
+                'name'          => 
'kafka.server:type=ReplicaFetcherManager,name=Replica-MaxLag',
+                'attrs'         => {
+                    'Value' => { 'units' => 'messages',   'slope' => 'both' },
+                },
+            },
+            {
+                'name'          => 
'kafka.server:type=ProducerRequestPurgatory,name=PurgatorySize',
+                'attrs'         => {
+                    'Value' => { 'units' => 'messages', 'slope' => 'both' },
+                },
+            },
+            {
+                'name'          => 
'kafka.server:type=FetchRequestPurgatory,name=PurgatorySize',
+                'attrs'         => {
+                    'Value' => { 'units' => 'messages', 'slope' => 'both' },
+                },
+            },
+            {
+                'name'          => 'kafka.network:type=RequestMetrics,name=*',
+                'typeNames'     => ['name'],
+                'attrs'         => {
+                    'Count' => { 'slope' => 'both' },
+                },
+            },
+            {
+                'name'          => 
'kafka.controller:type=KafkaController,name=*',
+                'typeNames'     => ['name'],
+                'attrs'         => {
+                    'Value' => { 'slope' => 'both' },
+                },
+            },
+            {
+                'name'          => 
'kafka.controller:type=ControllerStats,name=*',
+                'typeNames'     => ['name'],
+                'attrs'         => {
+                    'Count' => { 'slope' => 'both' },
+                },
+            },
+        ]
+    }
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0896eed96492efb1da438d1a260f14aa9dab9bc3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/kafka
Gerrit-Branch: master
Gerrit-Owner: Ottomata <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>

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

Reply via email to