From 26173af8577d3c11904196a04ca0b158f339bd64 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Sun, 25 Jun 2017 21:47:43 +0200 Subject: Enables metrics export to Prometheus, but they look very uninteresting. The selected config is from the jmx_exporter examples. --- README.md | 2 ++ zookeeper/50zoo.yml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index cb401d1..8b469cd 100644 --- a/README.md +++ b/README.md @@ -86,4 +86,6 @@ Is the metrics system up and running? ``` kubectl logs -c metrics kafka-0 kubectl exec -c broker kafka-0 -- /bin/sh -c 'apk add --no-cache curl && curl http://localhost:5556/metrics' +kubectl logs -c metrics zoo-0 +kubectl exec -c zookeeper zoo-0 -- /bin/sh -c 'apk add --no-cache curl && curl http://localhost:5556/metrics' ``` diff --git a/zookeeper/50zoo.yml b/zookeeper/50zoo.yml index 9251ce1..12d9c44 100644 --- a/zookeeper/50zoo.yml +++ b/zookeeper/50zoo.yml @@ -10,11 +10,27 @@ spec: metadata: labels: app: zookeeper + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "5556" spec: terminationGracePeriodSeconds: 10 containers: + - name: metrics + image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d + command: + - "java" + - "-jar" + - "jmx_prometheus_httpserver.jar" + - "5556" + - example_configs/zookeeper.yaml + ports: + - containerPort: 5556 - name: zookeeper image: solsson/kafka:0.11.0.0-rc2@sha256:c1316e0131f4ec83bc645ca2141e4fda94e0d28f4fb5f836e15e37a5e054bdf1 + env: + - name: JMX_PORT + value: "5555" command: - sh - -c -- cgit v1.2.3