Skip to content

Commit b8cf4ab

Browse files
committed
Found a working example, verified with Yolean/kubernetes-kafka#30
1 parent 09f86c0 commit b8cf4ab

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

kafka-prometheus-jmx-exporter/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ RUN set -e; \
2727

2828
RUN apk add --no-cache bash
2929

30-
ENTRYPOINT ["java", "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.port=5555", "-jar", "jmx_prometheus_httpserver.jar"]
31-
# https://github.com/prometheus/jmx_exporter/tree/master/example_configs
32-
CMD ["5556", "example_configs/kafka-0-8-2.yml"]
30+
# Use a sample config that also has a Grafana dashboard https://blog.rntech.co.uk/2016/10/20/monitoring-apache-kafka-with-prometheus/
31+
# Mount your own yml, for example using ConfigMap, or set Kafka JMX_PORT=5555
32+
RUN apk add --no-cache --virtual .build-deps curl; \
33+
curl -SLs -o example_configs/kafka-prometheus-monitoring.yml \
34+
https://raw.githubusercontent.com/rama-nallamilli/kafka-prometheus-monitoring/c4ee0e6b03386375b9b9e66b3fcbf4a704bec8f5/prometheus-jmx-exporter/confd/templates/kafka.yml.tmpl; \
35+
sed -i 's|{{ getv "/jmx/host" }}|127.0.0.1|' example_configs/kafka-prometheus-monitoring.yml; \
36+
sed -i 's|{{ getv "/jmx/port" }}|5555|' example_configs/kafka-prometheus-monitoring.yml; \
37+
apk del .build-deps;
38+
39+
ENTRYPOINT ["java", "-jar", "jmx_prometheus_httpserver.jar"]
40+
CMD ["5556", "example_configs/kafka-prometheus-monitoring.yml"]

0 commit comments

Comments
 (0)