Skip to content

Exposes JMX for brokers, and exemplify key cluster-level metric #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions kafka/50kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ spec:
env:
- name: KAFKA_LOG4J_OPTS
value: -Dlog4j.configuration=file:/etc/kafka/log4j.properties
- name: JMX_PORT
value: "5555"
ports:
- name: inside
containerPort: 9092
- name: outside
containerPort: 9094
- name: jmx
containerPort: 5555
command:
- ./bin/kafka-server-start.sh
- /etc/kafka/server.properties
Expand Down
14 changes: 14 additions & 0 deletions monitoring/10-monitoring-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: ConfigMap
metadata:
name: monitoring-config
namespace: kafka
apiVersion: v1
data:
cluster-prometheus-jmx.yml: |+
#lowercaseOutputName: true
jmxUrl: service:jmx:rmi:///jndi/rmi://cluster-jmx:5555/jmxrmi
ssl: false
whitelistObjectNames:
- kafka.server:type=ReplicaManager,*
rules:
- pattern: kafka.server<type=ReplicaManager, name=(PartitionCount|UnderReplicatedPartitions)><>(Value|Count)
49 changes: 49 additions & 0 deletions monitoring/brokers-prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: brokers-prometheus
namespace: kafka
spec:
replicas: 1
selector:
matchLabels:
role: metrics
type: exporter
target: kafka-broker
level: cluster
template:
metadata:
labels:
role: metrics
type: exporter
target: kafka-broker
level: cluster
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "5556"
spec:
containers:
- name: exporter
image: solsson/kafka-prometheus-jmx-exporter@sha256:40a6ab24ccac0ed5acb8c02dccfbb1f5924fd97f46c0450e0245686c24138b53
command:
- java
- -jar
- jmx_prometheus_httpserver.jar
- "5556"
- /etc/kafka/cluster-prometheus-jmx.yml
ports:
- containerPort: 5556
resources:
requests:
cpu: 0m
memory: 40Mi
limits:
cpu: 100m
memory: 80Mi
volumeMounts:
- name: config
mountPath: /etc/kafka
volumes:
- name: config
configMap:
name: monitoring-config
12 changes: 12 additions & 0 deletions monitoring/cluster-jmx-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: cluster-jmx
namespace: kafka
spec:
ports:
- name: jmx
port: 5555
selector:
app: kafka