Skip to content

Commit 4a56062

Browse files
authored
Merge pull request #31 from Yolean/metrics-via-jmx
Add metrics exporter for Prometheus
2 parents 5919d45 + a1823a8 commit 4a56062

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

50kafka.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@ spec:
1010
metadata:
1111
labels:
1212
app: kafka
13+
annotations:
14+
prometheus.io/scrape: "true"
15+
prometheus.io/port: "5556"
1316
spec:
1417
terminationGracePeriodSeconds: 10
1518
containers:
19+
- name: metrics
20+
image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d
21+
ports:
22+
- containerPort: 5556
1623
- name: broker
1724
image: solsson/kafka:0.11.0.0-rc2@sha256:c1316e0131f4ec83bc645ca2141e4fda94e0d28f4fb5f836e15e37a5e054bdf1
25+
env:
26+
- name: JMX_PORT
27+
value: "5555"
1828
ports:
1929
- containerPort: 9092
2030
command:

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ Testing and retesting... delete the namespace. PVs are outside namespaces so del
7878
kubectl delete namespace kafka
7979
rm -R ./data/ && kubectl -n kafka delete pv datadir-kafka-0 datadir-kafka-1 datadir-kafka-2
8080
```
81+
82+
## Metrics, Prometheus style
83+
84+
Is the metrics system up and running?
85+
```
86+
kubectl logs -c metrics kafka-0
87+
kubectl exec -c broker kafka-0 -- /bin/sh -c 'apk add --no-cache curl && curl http://localhost:5556/metrics'
88+
```

0 commit comments

Comments
 (0)