1 kind: ConfigMap
2 apiVersion: v1
3 metadata:
4 name: kafka-metrics
5 labels:
6 app: strimzi
7 data:
8 kafka-metrics-config.yml: |
9 # See https://github.com/prometheus/jmx_exporter for more info about JMX Prometheus Exporter metrics
10 lowercaseOutputName: true
11 rules:
12 # Special cases and very specific rules
13 - pattern: kafka.server<type=(.+), name=(.+), clientId=(.+), topic=(.+), partition=(.*)><>Value
14 name: kafka_server_$1_$2
15 type: GAUGE
16 labels:
17 clientId: "$3"
18 topic: "$4"
19 partition: "$5"
20 - pattern: kafka.server<type=(.+), name=(.+), clientId=(.+), brokerHost=(.+), brokerPort=(.+)><>Value
21 name: kafka_server_$1_$2
22 type: GAUGE
23 labels:
24 clientId: "$3"
25 broker: "$4:$5"
26 - pattern: kafka.server<type=(.+), cipher=(.+), protocol=(.+), listener=(.+), networkProcessor=(.+)><>connections
27 name: kafka_server_$1_connections_tls_info
28 type: GAUGE
29 labels:
30 cipher: "$2"
31 protocol: "$3"
32 listener: "$4"
33 networkProcessor: "$5"
34 - pattern: kafka.server<type=(.+), clientSoftwareName=(.+), clientSoftwareVersion=(.+), listener=(.+), networkProcessor=(.+)><>connections
35 name: kafka_server_$1_connections_software
36 type: GAUGE
37 labels:
38 clientSoftwareName: "$2"
39 clientSoftwareVersion: "$3"
40 listener: "$4"
41 networkProcessor: "$5"
42 - pattern: "kafka.server<type=(.+), listener=(.+), networkProcessor=(.+)><>(.+):"
43 name: kafka_server_$1_$4
44 type: GAUGE
45 labels:
46 listener: "$2"
47 networkProcessor: "$3"
48 - pattern: kafka.server<type=(.+), listener=(.+), networkProcessor=(.+)><>(.+)
49 name: kafka_server_$1_$4
50 type: GAUGE
51 labels:
52 listener: "$2"
53 networkProcessor: "$3"
54 # Some percent metrics use MeanRate attribute
55 # Ex) kafka.server<type=(KafkaRequestHandlerPool), name=(RequestHandlerAvgIdlePercent)><>MeanRate
56 - pattern: kafka.(\w+)<type=(.+), name=(.+)Percent\w*><>MeanRate
57 name: kafka_$1_$2_$3_percent
58 type: GAUGE
59 # Generic gauges for percents
60 - pattern: kafka.(\w+)<type=(.+), name=(.+)Percent\w*><>Value
61 name: kafka_$1_$2_$3_percent
62 type: GAUGE
63 - pattern: kafka.(\w+)<type=(.+), name=(.+)Percent\w*, (.+)=(.+)><>Value
64 name: kafka_$1_$2_$3_percent
65 type: GAUGE
66 labels:
67 "$4": "$5"
68 # Generic per-second counters with 0-2 key/value pairs
69 - pattern: kafka.(\w+)<type=(.+), name=(.+)PerSec\w*, (.+)=(.+), (.+)=(.+)><>Count
70 name: kafka_$1_$2_$3_total
71 type: COUNTER
72 labels:
73 "$4": "$5"
74 "$6": "$7"
75 - pattern: kafka.(\w+)<type=(.+), name=(.+)PerSec\w*, (.+)=(.+)><>Count
76 name: kafka_$1_$2_$3_total
77 type: COUNTER
78 labels:
79 "$4": "$5"
80 - pattern: kafka.(\w+)<type=(.+), name=(.+)PerSec\w*><>Count
81 name: kafka_$1_$2_$3_total
82 type: COUNTER
83 # Generic gauges with 0-2 key/value pairs
84 - pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+), (.+)=(.+)><>Value
85 name: kafka_$1_$2_$3
86 type: GAUGE
87 labels:
88 "$4": "$5"
89 "$6": "$7"
90 - pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+)><>Value
91 name: kafka_$1_$2_$3
92 type: GAUGE
93 labels:
94 "$4": "$5"
95 - pattern: kafka.(\w+)<type=(.+), name=(.+)><>Value
96 name: kafka_$1_$2_$3
97 type: GAUGE
98 # Emulate Prometheus 'Summary' metrics for the exported 'Histogram's.
99 # Note that these are missing the '_sum' metric!
100 - pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+), (.+)=(.+)><>Count
101 name: kafka_$1_$2_$3_count
102 type: COUNTER
103 labels:
104 "$4": "$5"
105 "$6": "$7"
106 - pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.*), (.+)=(.+)><>(\d+)thPercentile
107 name: kafka_$1_$2_$3
108 type: GAUGE
109 labels:
110 "$4": "$5"
111 "$6": "$7"
112 quantile: "0.$8"
113 - pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+)><>Count
114 name: kafka_$1_$2_$3_count
115 type: COUNTER
116 labels:
117 "$4": "$5"
118 - pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.*)><>(\d+)thPercentile
119 name: kafka_$1_$2_$3
120 type: GAUGE
121 labels:
122 "$4": "$5"
123 quantile: "0.$6"
124 - pattern: kafka.(\w+)<type=(.+), name=(.+)><>Count
125 name: kafka_$1_$2_$3_count
126 type: COUNTER
127 - pattern: kafka.(\w+)<type=(.+), name=(.+)><>(\d+)thPercentile
128 name: kafka_$1_$2_$3
129 type: GAUGE
130 labels:
131 quantile: "0.$4"
132 zookeeper-metrics-config.yml: |
133 # See https://github.com/prometheus/jmx_exporter for more info about JMX Prometheus Exporter metrics
134 lowercaseOutputName: true
135 rules:
136 # replicated Zookeeper
137 - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+)><>(\\w+)"
138 name: "zookeeper_$2"
139 type: GAUGE
140 - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+)><>(\\w+)"
141 name: "zookeeper_$3"
142 type: GAUGE
143 labels:
144 replicaId: "$2"
145 - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+), name2=(\\w+)><>(Packets\\w+)"
146 name: "zookeeper_$4"
147 type: COUNTER
148 labels:
149 replicaId: "$2"
150 memberType: "$3"
151 - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+), name2=(\\w+)><>(\\w+)"
152 name: "zookeeper_$4"
153 type: GAUGE
154 labels:
155 replicaId: "$2"
156 memberType: "$3"
157 - pattern: "org.apache.ZooKeeperService<name0=ReplicatedServer_id(\\d+), name1=replica.(\\d+), name2=(\\w+), name3=(\\w+)><>(\\w+)"
158 name: "zookeeper_$4_$5"
159 type: GAUGE
160 labels:
161 replicaId: "$2"
162 memberType: "$3"