# Source: cp-helm-charts/charts/cp-zookeeper/templates/jmx-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: cp-helm-charts-cp-zookeeper-jmx-configmap
  labels:
    app: cp-zookeeper
    chart: cp-zookeeper-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-zookeeper-prometheus.yml: |
    jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:5555/jmxrmi
    lowercaseOutputName: true
    lowercaseOutputLabelNames: true
    ssl: false
    whitelistObjectNames:
    - org.apache.ZooKeeperService:name0=ReplicatedServer_id*
    - org.apache.ZooKeeperService:name0=ReplicatedServer_id*,name1=replica.*
    - org.apache.ZooKeeperService:name0=ReplicatedServer_id*,name1=replica.*,name2=*
    - org.apache.ZooKeeperService:name0=ReplicatedServer_id*,name1=replica.*,name2=*,name3=*
    rules:
    - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+)><>(\\w+)"
      name: "cp_zookeeper_$2"
    - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+)><>(\\w+)"
      name: "cp_zookeeper_$3"
      labels:
        replicaId: "$2"
    - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+), name2=(\\w+)><>(\\w+)"
      name: "cp_zookeeper_$4"
      labels:
        replicaId: "$2"
        memberType: "$3"
    - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+), name2=(\\w+), name3=(\\w+)><>(\\w+)"
      name: "cp_zookeeper_$4_$5"
      labels:
        replicaId: "$2"
        memberType: "$3"
