Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 50 lines (50 sloc) 2.23 KB
###############################################################################
#
# Licensed Materials - Property of IBM
#
# (C) Copyright IBM Corp. 2018. All Rights Reserved.
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
###############################################################################
# Defines a config map that identifies the metrics from the Kafka brokers that
# should be pushed to Prometheus to allow Kafka cluster activity to be
# monitored.
###############################################################################
{{ if eq .Values.license "accept" -}}
{{ $namePrefix := .sch.chart.components.kafka.metricsConfigMap.name -}}
{{ $name := include "sch.names.fullCompName" (list . $namePrefix ) -}}
# Component is 'kafka' as this makes up part of implementing the Kafka cluster
{{ $compName := .sch.chart.components.kafka.compName -}}
{{ $labels := include "sch.metadata.labels.standard" (list . $compName) -}}
# import port definitions
{{- include "sch.config.init" (list . "ports.sch.chart.config.values") | trim -}}
{{ $ports := .sch.config.ports }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $name | quote }}
namespace: {{ include "restrict.namespace" (list . .Release.Namespace) }}
labels:
{{ $labels | indent 4 }}
data:
kafka-config.yaml: |-
startDelaySecs: 10
hostPort: 127.0.0.1:{{ $ports.kafka.metricsLocalHost }}
lowercaseOutputName: true
rules:
# Rules below match the Kafka MBeans in the jconsole order
# Match all kafka.controller but per broker queue size
- pattern : kafka.controller<type=(\w+), name=(\w+)><>(Count|Value|Mean)
name: kafka_controller_$1_$2_$3
# kafka.server
# Broker metrics
- pattern : kafka.server<type=BrokerTopicMetrics, name=(BytesInPerSec|BytesOutPerSec)><>(Count)
name: kafka_server_BrokerTopicMetrics_$1_$2
- pattern : kafka.server<type=BrokerTopicMetrics, name=(BytesInPerSec|BytesOutPerSec)><>(OneMinuteRate)
name: kafka_server_BrokerTopicMetrics_$1__alltopics_$2
# Broker Replica Manager
- pattern: kafka.server<type=ReplicaManager, name=(\w+)><>(Value)
name: kafka_server_ReplicaManager_$1_$2
{{ end -}}