apiVersion: kafka.strimzi.io/v1alpha1 kind: Kafka metadata: name: my-cluster spec: kafka: replicas: 3 listeners: plain: {} tls: {} readinessProbe: initialDelaySeconds: 15 timeoutSeconds: 5 livenessProbe: initialDelaySeconds: 15 timeoutSeconds: 5 config: offsets.topic.replication.factor: 3 transaction.state.log.replication.factor: 3 transaction.state.log.min.isr: 2 storage: type: persistent-claim size: 1Gi deleteClaim: false metrics: # Inspired by config from Kafka 2.0.0 example rules: # https://github.com/prometheus/jmx_exporter/blob/master/example_configs/kafka-2_0_0.yml lowercaseOutputName: true rules: # Special cases and very specific rules - pattern : kafka.server<>Value name: kafka_server_$1_$2 type: GAUGE labels: clientId: "$3" topic: "$4" partition: "$5" - pattern : kafka.server<>Value name: kafka_server_$1_$2 type: GAUGE labels: clientId: "$3" broker: "$4:$5" # Some percent metrics use MeanRate attribute # Ex) kafka.server<>MeanRate - pattern: kafka.(\w+)<>MeanRate name: kafka_$1_$2_$3_percent type: GAUGE # Generic gauges for percents - pattern: kafka.(\w+)<>Value name: kafka_$1_$2_$3_percent type: GAUGE - pattern: kafka.(\w+)<>Value name: kafka_$1_$2_$3_percent type: GAUGE labels: "$4": "$5" # Generic per-second counters with 0-2 key/value pairs - pattern: kafka.(\w+)<>Count name: kafka_$1_$2_$3_total type: COUNTER labels: "$4": "$5" "$6": "$7" - pattern: kafka.(\w+)<>Count name: kafka_$1_$2_$3_total type: COUNTER labels: "$4": "$5" - pattern: kafka.(\w+)<>Count name: kafka_$1_$2_$3_total type: COUNTER # Generic gauges with 0-2 key/value pairs - pattern: kafka.(\w+)<>Value name: kafka_$1_$2_$3 type: GAUGE labels: "$4": "$5" "$6": "$7" - pattern: kafka.(\w+)<>Value name: kafka_$1_$2_$3 type: GAUGE labels: "$4": "$5" - pattern: kafka.(\w+)<>Value name: kafka_$1_$2_$3 type: GAUGE # Emulate Prometheus 'Summary' metrics for the exported 'Histogram's. # Note that these are missing the '_sum' metric! - pattern: kafka.(\w+)<>Count name: kafka_$1_$2_$3_count type: COUNTER labels: "$4": "$5" "$6": "$7" - pattern: kafka.(\w+)<>(\d+)thPercentile name: kafka_$1_$2_$3 type: GAUGE labels: "$4": "$5" "$6": "$7" quantile: "0.$8" - pattern: kafka.(\w+)<>Count name: kafka_$1_$2_$3_count type: COUNTER labels: "$4": "$5" - pattern: kafka.(\w+)<>(\d+)thPercentile name: kafka_$1_$2_$3 type: GAUGE labels: "$4": "$5" quantile: "0.$6" - pattern: kafka.(\w+)<>Count name: kafka_$1_$2_$3_count type: COUNTER - pattern: kafka.(\w+)<>(\d+)thPercentile name: kafka_$1_$2_$3 type: GAUGE labels: quantile: "0.$4" zookeeper: replicas: 3 readinessProbe: initialDelaySeconds: 15 timeoutSeconds: 5 livenessProbe: initialDelaySeconds: 15 timeoutSeconds: 5 storage: type: persistent-claim size: 1Gi deleteClaim: false metrics: # Inspired by Zookeeper rules # https://github.com/prometheus/jmx_exporter/blob/master/example_configs/zookeeper.yaml lowercaseOutputName: true rules: # replicated Zookeeper - pattern: "org.apache.ZooKeeperService<>(\\w+)" name: "zookeeper_$2" - pattern: "org.apache.ZooKeeperService<>(\\w+)" name: "zookeeper_$3" labels: replicaId: "$2" - pattern: "org.apache.ZooKeeperService<>(\\w+)" name: "zookeeper_$4" labels: replicaId: "$2" memberType: "$3" - pattern: "org.apache.ZooKeeperService<>(\\w+)" name: "zookeeper_$4_$5" labels: replicaId: "$2" memberType: "$3" # standalone Zookeeper - pattern: "org.apache.ZooKeeperService<>(\\w+)" name: "zookeeper_$2" - pattern: "org.apache.ZooKeeperService<>(\\w+)" name: "zookeeper_$2_$3" entityOperator: topicOperator: {} userOperator: {}