Ottomata has uploaded a new change for review.
https://gerrit.wikimedia.org/r/230699
Change subject: Send 0.8.2.1 Kafka metrics via jmxtrans to graphite/ganglia
......................................................................
Send 0.8.2.1 Kafka metrics via jmxtrans to graphite/ganglia
Change-Id: I0ca070e3aa6fcd7387242304a715941fe3ccc2f9
---
M manifests/role/analytics/kafka.pp
1 file changed, 208 insertions(+), 16 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/99/230699/1
diff --git a/manifests/role/analytics/kafka.pp
b/manifests/role/analytics/kafka.pp
index 26d73c5..15d40fd 100644
--- a/manifests/role/analytics/kafka.pp
+++ b/manifests/role/analytics/kafka.pp
@@ -187,35 +187,227 @@
jvm_performance_opts => '-server -XX:PermSize=48m
-XX:MaxPermSize=48m -XX:+UseG1GC -XX:MaxGCPauseMillis=20
-XX:InitiatingHeapOccupancyPercent=35',
}
+ $kafka_rate_jmx_attrs = {
+ 'Count' => { 'slope' => 'positive', 'bucketType' => 'g' },
+ 'FifteenMinuteRate' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'FiveMinuteRate' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'OneMinuteRate' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'MeanRate' => { 'slope' => 'both', 'bucketType' => 'g' },
+ }
+ $kafka_timing_jmx_attrs = {
+ '50thPercentile' => { 'slope' => 'both', 'bucketType' => 'g' },
+ '75ththPercentile' => { 'slope' => 'both', 'bucketType' => 'g' },
+ '95thPercentile' => { 'slope' => 'both', 'bucketType' => 'g' },
+ '98thPercentile' => { 'slope' => 'both', 'bucketType' => 'g' },
+ '99thPercentile' => { 'slope' => 'both', 'bucketType' => 'g' },
+ '999thPercentile' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'Count' => { 'slope' => 'positive', 'bucketType' => 'g' },
+ 'Max' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'Mean' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'Min' => { 'slope' => 'both', 'bucketType' => 'g' },
+ 'StdDev' => { 'slope' => 'both', 'bucketType' => 'g' },
+ }
+ $kafka_value_jmx_attrs = {
+ 'Value' => { 'slope' => 'both', 'bucketType' => 'g' },
+ }
+
+
# Include Kafka Server Jmxtrans class
# to send Kafka Broker metrics to Ganglia and statsd.
class { '::kafka::server::jmxtrans':
ganglia => "${ganglia_host}:${ganglia_port}",
statsd => "${statsd_host}:${statsd_port}",
+
+ # 0.8.2.1 JMX metrics.
+ # TODO: this will be moved into kafka module soon.
objects => [
+ # All Topic Metrics
{
'name' =>
'kafka.server:type=BrokerTopicMetrics,name=*',
'resultAlias' => 'kafka.server.BrokerTopicMetrics-AllTopics',
'typeNames' => ['name'],
- 'attrs' => {
- 'Count' => { 'slope' => 'positive',
'bucketType' => 'g' },
- 'FifteenMinuteRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- 'FiveMinuteRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- 'OneMinuteRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- 'MeanRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- },
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+ # Per Topic Metrics
+ {
+ 'name' =>
'kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec,topic=*',
+ 'resultAlias' =>
'kafka.server.BrokerTopicMetrics.BytesInPerSec',
+ 'typeNames' => ['topic'],
+ 'attrs' => $kafka_rate_jmx_attrs,
},
{
- 'name' =>
'kafka.server:type=BrokerTopicMetrics,name=*,topic=*',
- 'resultAlias' => 'kafka.server.BrokerTopicMetrics',
+ 'name' =>
'kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec,topic=*',
+ 'resultAlias' =>
'kafka.server.BrokerTopicMetrics.BytesOutPerSec',
+ 'typeNames' => ['topic'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.network:type=BrokerTopicMetrics,name=BytesRejectedPerSec,topic=*',
+ 'resultAlias' =>
'kafka.network.BrokerTopicMetrics.BytesRejectedPerSec',
+ 'typeNames' => ['topic'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.network:type=BrokerTopicMetrics,name=FailedFetchRequestsPerSec,topic=*',
+ 'resultAlias' =>
'kafka.network.BrokerTopicMetrics.FailedFetchRequestsPerSec',
+ 'typeNames' => ['topic'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.network:type=BrokerTopicMetrics,name=FailedProduceRequestsPerSec,topic=*',
+ 'resultAlias' =>
'kafka.network.BrokerTopicMetrics.FailedProduceRequestsPerSec',
+ 'typeNames' => ['topic'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec,topic=*',
+ 'resultAlias' =>
'kafka.server.BrokerTopicMetrics.MessagesInPerSec',
+ 'typeNames' => ['topic'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+
+ # ReplicaManager Metrics
+ {
+ 'name' => 'kafka.server:type=ReplicaManager,name=*',
+ 'resultAlias' => 'kafka.server.ReplicaManager',
'typeNames' => ['name'],
- 'attrs' => {
- 'Count' => { 'slope' => 'positive',
'bucketType' => 'g' },
- 'FifteenMinuteRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- 'FiveMinuteRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- 'OneMinuteRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- 'MeanRate' => { 'slope' => 'both',
'bucketType' => 'g' },
- },
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+
+ # ReplicaFetcherManager
+ {
+ 'name' =>
'kafka.server:type=ReplicaFetcherManager,name=*,clientId=Replica',
+ 'resultAlias' => 'kafka.server.ReplicaFetcherManager',
+ 'typeNames' => ['name'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+
+ # Produce/Fetch Request Purgatory Metrics
+ {
+ 'name' =>
'kafka.server:type=ProducerRequestPurgatory,name=*',
+ 'resultAlias' => 'kafka.server.ProducerRequestPurgatory',
+ 'typeNames' => ['name'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.server:type=FetchRequestPurgatory,name=*',
+ 'resultAlias' => 'kafka.server.FetchRequestPurgatory',
+ 'typeNames' => ['name'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+
+ # Request Handler Percent Idle
+ {
+ 'name' =>
'kafka.server:type=KafkaRequestHandlerPool,name=*',
+ 'resultAlias' => 'kafka.server.KafkaRequestHandlerPool',
+ 'typeNames' => ['name'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+
+
+ # Request Metrics
+
+ # Requests Type Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=RequestsPerSec,request=*',
+ 'resultAlias' =>
'kafka.network.RequestMetrics.RequestsPerSec',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_rate_jmx_attrs,
+ },
+ # Request/Response Local Time Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=LocalTimeMs,request=*',
+ 'resultAlias' => 'kafka.network.RequestMetrics.LocalTimeMs',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_timing_jmx_attrs,
+ },
+ # Request/Response Remote Time Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=RemoteTimeMs,request=*',
+ 'resultAlias' => 'kafka.network.RequestMetrics.RemoteTimeMs',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_timing_jmx_attrs,
+ },
+ # Request Queue Time Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=RequestQueueTimeMs,request=*',
+ 'resultAlias' =>
'kafka.network.RequestMetrics.RequestQueueTimeMs',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_timing_jmx_attrs,
+ },
+ # Response Queue Time Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=*',
+ 'resultAlias' =>
'kafka.network.RequestMetrics.ResponseQueueTimeMs',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_timing_jmx_attrs,
+ },
+ # Response Send Time Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=*',
+ 'resultAlias' =>
'kafka.network.RequestMetrics.ResponseSendTimeMs',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_timing_jmx_attrs,
+ },
+ # Request/Response Total Time Metrics
+ {
+ 'name' =>
'kafka.network:type=RequestMetrics,name=TotalTimeMs,request=*',
+ 'resultAlias' => 'kafka.network.RequestMetrics.TotalTimeMs',
+ 'typeNames' => ['request'],
+ 'attrs' => $kafka_timing_jmx_attrs,
+ },
+
+ # Log Flush Metrics
+ {
+ 'name' => 'kafka.log:type=LogFlushStats,name=*',
+ 'resultAlias' => 'kafka.log.LogFlushStats',
+ 'typeNames' => ['name'],
+ 'attrs' => merge($kafka_timing_jmx_attrs,
$kafka_rate_jmx_attrs),
+ },
+
+ # Per topic-partition Metrics
+ {
+ 'name' =>
'kafka.log:type=Log,name=LogStartOffset,topic=*,partition=*',
+ 'resultAlias' => 'kafka.log.LogStartOffset',
+ 'typeNames' => ['topic', 'partition'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.log:type=Log,name=LogEndOffset,topic=*,partition=*',
+ 'resultAlias' => 'kafka.log.LogEndOffset',
+ 'typeNames' => ['topic', 'partition'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+ {
+ 'name' =>
'kafka.log:type=Log,name=Size,topic=*,partition=*',
+ 'resultAlias' => 'kafka.log.Size',
+ 'typeNames' => ['topic', 'partition'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+
+
+ # Controller Info
+ {
+ 'name' =>
'kafka.controller:type=KafkaController,name=*',
+ 'resultAlias' => 'kafka.controller.KafkaController',
+ 'typeNames' => ['name'],
+ 'attrs' => $kafka_value_jmx_attrs,
+ },
+ # Controller Metrics
+ {
+ 'name' =>
'kafka.controller:type=ControllerStats,name=*',
+ 'resultAlias' => 'kafka.controller.ControllerStats',
+ 'typeNames' => ['name'],
+ 'attrs' => merge($kafka_timing_jmx_attrs,
$kafka_rate_jmx_attrs),
+ },
+
+ # Per topic-partition UnderReplicated Partition Metrics
+ # TODO: fix this metric
+ {
+ 'name' =>
'kafka.cluster:type=Partition,name=UnderReplicated,topic=*,partition=*',
+ 'resultAlias' => 'kafka.cluster.Partition.UnderReplicated',
+ 'typeNames' => ['topic, partition'],
+ 'attrs' => $kafka_value_jmx_attrs,
},
]
}
--
To view, visit https://gerrit.wikimedia.org/r/230699
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ca070e3aa6fcd7387242304a715941fe3ccc2f9
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