# Source: cp-helm-charts/charts/cp-kafka/templates/jmx-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: cp-helm-charts-cp-kafka-jmx-configmap
  labels:
    app: cp-kafka
    chart: cp-kafka-0.1.0
    release: cp-helm-charts
    heritage: Helm
    gitops.jenkins-x.io/pipeline: 'namespaces'
  annotations:
    meta.helm.sh/release-name: 'cp-helm-charts'
  namespace: kafka
data:
  jmx-kafka-prometheus.yml: |
    jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:5555/jmxrmi
    lowercaseOutputName: true
    lowercaseOutputLabelNames: true
    ssl: false
    whitelistObjectNames:
    - kafka.server:type=ReplicaManager,name=*
    - kafka.controller:type=KafkaController,name=*
    - kafka.server:type=BrokerTopicMetrics,name=*
    - kafka.network:type=RequestMetrics,name=RequestsPerSec,request=*
    - kafka.network:type=SocketServer,name=NetworkProcessorAvgIdlePercent
    - kafka.server:type=ReplicaFetcherManager,name=MaxLag,clientId=*
    - kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent
    - kafka.controller:type=ControllerStats,name=*
    - kafka.server:type=SessionExpireListener,name=*
    rules:
    - pattern : kafka.server<type=ReplicaManager, name=(.+)><>(Value|OneMinuteRate)
      name: "cp_kafka_server_replicamanager_$1"
    - pattern : kafka.controller<type=KafkaController, name=(.+)><>Value
      name: "cp_kafka_controller_kafkacontroller_$1"
    - pattern : kafka.server<type=BrokerTopicMetrics, name=(.+)><>OneMinuteRate
      name: "cp_kafka_server_brokertopicmetrics_$1"
    - pattern : kafka.network<type=RequestMetrics, name=RequestsPerSec, request=(.+)><>OneMinuteRate
      name: "cp_kafka_network_requestmetrics_requestspersec_$1"
    - pattern : kafka.network<type=SocketServer, name=NetworkProcessorAvgIdlePercent><>Value
      name: "cp_kafka_network_socketserver_networkprocessoravgidlepercent"
    - pattern : kafka.server<type=ReplicaFetcherManager, name=MaxLag, clientId=(.+)><>Value
      name: "cp_kafka_server_replicafetchermanager_maxlag_$1"
    - pattern : kafka.server<type=KafkaRequestHandlerPool, name=RequestHandlerAvgIdlePercent><>OneMinuteRate
      name: "cp_kafka_kafkarequesthandlerpool_requesthandleravgidlepercent"
    - pattern : kafka.controller<type=ControllerStats, name=(.+)><>OneMinuteRate
      name: "cp_kafka_controller_controllerstats_$1"
    - pattern : kafka.server<type=SessionExpireListener, name=(.+)><>OneMinuteRate
      name: "cp_kafka_server_sessionexpirelistener_$1"
