{{- if (include "kafka.metrics.jmx.createConfigmap" .) }} apiVersion: v1 kind: ConfigMap metadata: name: {{ printf "%s-jmx-configuration" (include "common.names.fullname" .) }} namespace: {{ .Release.Namespace | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: metrics {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} data: jmx-kafka-prometheus.yml: |- {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.jmx.config "context" $ ) | nindent 4 }} rules: - pattern: kafka.controller<>(Value) name: kafka_controller_$1_$2_$4 labels: broker_id: "$3" - pattern: kafka.controller<>(Value) name: kafka_controller_$1_$2_$3 - pattern: kafka.controller<>(Value) name: kafka_controller_$1_$2_$3 - pattern: kafka.controller<>(Count) name: kafka_controller_$1_$2_$3 - pattern: kafka.server<>(Value) name: kafka_server_$1_$2_$4 labels: client_id: "$3" - pattern : kafka.network<>(Value) name: kafka_network_$1_$2_$4 labels: network_processor: $3 - pattern : kafka.network<>(Count) name: kafka_network_$1_$2_$4 labels: request: $3 - pattern: kafka.server<>(Count|OneMinuteRate) name: kafka_server_$1_$2_$4 labels: topic: $3 - pattern: kafka.server<>(Value) name: kafka_server_$1_$2_$3_$4 - pattern: kafka.server<>(Count|Value|OneMinuteRate) name: kafka_server_$1_total_$2_$3 - pattern: kafka.server<>(queue-size) name: kafka_server_$1_$2 - pattern: java.lang<(.+)>(\w+) name: java_lang_$1_$4_$3_$2 - pattern: java.lang<>(\w+) name: java_lang_$1_$3_$2 - pattern : java.lang - pattern: kafka.log<>Value name: kafka_log_$1_$2 labels: topic: $3 partition: $4 {{- if .Values.metrics.jmx.extraRules }} {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.jmx.extraRules "context" $ ) | nindent 6 }} {{- end }} {{- end -}}