apiVersion: v1
kind: ConfigMap
metadata:
  name: think-confluent-cp-kafka-connect-jmx-configmap
  namespace: kafka
data:
  jmx-kafka-connect-prometheus.yml: |+
    jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:{{ .Values.jmx.port }}/jmxrmi
    lowercaseOutputName: true
    lowercaseOutputLabelNames: true
    ssl: false
    whitelistObjectNames:
    - kafka.connect:type=connect-worker-metrics
    - kafka.connect:type=connect-metrics, client-id=*
    - kafka.connect:type=connector-task-metrics, connector=*, task=*
    rules:
    - pattern : "kafka.connect<type=connect-worker-metrics>([^:]+):"
      name: "cp_kafka_connect_connect_worker_metrics_$1"
    - pattern : "kafka.connect<type=connect-metrics, client-id=([^:]+)><>([^:]+)"
      name: "cp_kafka_connect_connect_metrics_$1_$2"
    - pattern : "kafka.connect<type=connector-task-metrics, connector=([^:]+), task=([^:]+)><>status: ([^:]+)"
      name: "cp_kafka_connect_connect_connector_metrics"
      value: 1
      labels:
        connector: $1
        task: $2
        status: $3
