WIP:brokers
[demos/kafka/monitoring] / docker-compose.yml
index ba8849e..8b15b38 100644 (file)
@@ -5,10 +5,6 @@ services:
   zookeeper:
     build: zookeeper
     environment:
-      JVMFLAGS:
-        -Dcom.sun.management.jmxremote=true
-        -Dcom.sun.management.jmxremote.port=7070
-        -Dcom.sun.management.jmxremote.authenticate=false
       ALLOW_ANONYMOUS_LOGIN: 'yes'
       ZOO_ENABLE_PROMETHEUS_METRICS: 'yes'
     volumes:
@@ -20,7 +16,9 @@ services:
   kafka-1:
     build: kafka
     environment:
+      KAFKA_ENABLE_KRAFT: 'false'
       KAFKA_OPTS:
+        -javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=80:/opt/prometheus/config.yml
         -Dcom.sun.management.jmxremote=true
         -Dcom.sun.management.jmxremote.port=7000
         -Dcom.sun.management.jmxremote.authenticate=false
@@ -44,7 +42,9 @@ services:
   kafka-2:
     build: kafka
     environment:
+      KAFKA_ENABLE_KRAFT: 'false'
       KAFKA_OPTS:
+        -javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=80:/opt/prometheus/config.yml
         -Dcom.sun.management.jmxremote=true
         -Dcom.sun.management.jmxremote.port=7000
         -Dcom.sun.management.jmxremote.authenticate=false
@@ -73,7 +73,9 @@ services:
   kafka-3:
     build: kafka
     environment:
+      KAFKA_ENABLE_KRAFT: 'false'
       KAFKA_OPTS:
+        -javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=80:/opt/prometheus/config.yml
         -Dcom.sun.management.jmxremote=true
         -Dcom.sun.management.jmxremote.port=7000
         -Dcom.sun.management.jmxremote.authenticate=false
@@ -151,19 +153,51 @@ services:
       - ./prometheus.yml:/etc/prometheus/prometheus.yml
 
   grafana:
-    image: grafana/grafana
+    image: grafana/grafana:10.0.3
     ports:
       - "3000:3000"
+    environment:
+      GF_SECURITY_ADMIN_USER: juplo
+      GF_SECURITY_ADMIN_PASSWORD: juplo
     volumes:
+      - ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yaml
+      - ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/automatic.yaml
+      - ./kafka-overview.json:/var/lib/grafana/dashboards/main-dashboard.json
       - grafana:/var/lib/grafana
 
   producer:
     image: juplo/simple-producer:1.0-SNAPSHOT
+    entrypoint: >-
+        java
+        -Dcom.sun.management.jmxremote=true
+        -Dcom.sun.management.jmxremote.port=7000
+        -Dcom.sun.management.jmxremote.local.only=false
+        -Dcom.sun.management.jmxremote.authenticate=false
+        -Dcom.sun.management.jmxremote.ssl=false
+        -jar /opt/app.jar
     command: kafka:9092 test producer
+    ports:
+      - 7010:7000
 
   consumer:
     image: juplo/simple-consumer:1.0-SNAPSHOT
+    entrypoint: >-
+        java
+        -Dcom.sun.management.jmxremote=true
+        -Dcom.sun.management.jmxremote.port=7000
+        -Dcom.sun.management.jmxremote.local.only=false
+        -Dcom.sun.management.jmxremote.authenticate=false
+        -Dcom.sun.management.jmxremote.ssl=false
+        -jar /opt/app.jar
     command: kafka:9092 test my-group consumer
+    ports:
+      - 7020:7000
+
+  cli:
+    image: juplo/toolbox
+    command: sleep infinity
+    depends_on:
+      - setup
 
 volumes: