├── .DS_Store ├── rancher.png ├── k8s ├── .DS_Store ├── storageclass-aws-ebs.yaml ├── kafka │ ├── Dockerfile │ └── prometheus-config.yml ├── zookeeper │ ├── Dockerfile │ └── prometheus-config.yml ├── streaming-ephemeral.yaml └── streaming-persistent-aws-ebs.yaml ├── openshift.png ├── openshift ├── .DS_Store ├── kafka │ ├── Dockerfile │ └── prometheus-config.yml ├── zookeeper │ ├── Dockerfile │ └── prometheus-config.yml └── streaming-template-confluent-persistenti-gluster.yaml ├── grafana-dashboards.png ├── grafana-kafka-overview.png ├── grafana-kafka-dashboard.png ├── confluent-testclient-confluent-5.yaml ├── burrow-dashboard.yaml ├── kafkacat.yml ├── README.md ├── kafka-overview_rev1.json ├── grafana-kafka-dashboard.json └── grafana-kafka-dashboard-2.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/.DS_Store -------------------------------------------------------------------------------- /rancher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/rancher.png -------------------------------------------------------------------------------- /k8s/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/k8s/.DS_Store -------------------------------------------------------------------------------- /openshift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/openshift.png -------------------------------------------------------------------------------- /openshift/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/openshift/.DS_Store -------------------------------------------------------------------------------- /grafana-dashboards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/grafana-dashboards.png -------------------------------------------------------------------------------- /grafana-kafka-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/grafana-kafka-overview.png -------------------------------------------------------------------------------- /grafana-kafka-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/HEAD/grafana-kafka-dashboard.png -------------------------------------------------------------------------------- /confluent-testclient-confluent-5.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: confluent-client 5 | spec: 6 | containers: 7 | - name: confluent-client 8 | image: confluentinc/cp-kafka:5.0.0 9 | command: 10 | - sh 11 | - -c 12 | - "exec tail -f /dev/null" 13 | -------------------------------------------------------------------------------- /k8s/storageclass-aws-ebs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: gp2 5 | annotations: 6 | storageclass.kubernetes.io/is-default-class: "true" 7 | labels: 8 | kubernetes.io/cluster-service: "true" 9 | provisioner: kubernetes.io/aws-ebs 10 | parameters: 11 | type: gp2 12 | zone: "us-east-1a" 13 | -------------------------------------------------------------------------------- /k8s/kafka/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM confluentinc/cp-kafka:5.0.0 2 | 3 | ENV PROMETHEUS_EXPORTER_VERSION=0.3.1 4 | RUN mkdir -p /opt/prometheus/conf \ 5 | && curl -SLs "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${PROMETHEUS_EXPORTER_VERSION}/jmx_prometheus_javaagent-${PROMETHEUS_EXPORTER_VERSION}.jar" \ 6 | -o /opt/prometheus/jmx_prometheus_javaagent.jar \ 7 | && chmod 444 /opt/prometheus/jmx_prometheus_javaagent.jar \ 8 | && chmod 555 /opt/prometheus/conf 9 | 10 | ENV KAFKA_OPTS="-javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=5555:/opt/prometheus/conf/prometheus-config.yml" 11 | 12 | ADD prometheus-config.yml /opt/prometheus/conf/ 13 | -------------------------------------------------------------------------------- /k8s/zookeeper/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM confluentinc/cp-zookeeper:5.0.0 2 | 3 | ENV PROMETHEUS_EXPORTER_VERSION=0.3.1 4 | RUN mkdir -p /opt/prometheus/conf \ 5 | && curl -SLs "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${PROMETHEUS_EXPORTER_VERSION}/jmx_prometheus_javaagent-${PROMETHEUS_EXPORTER_VERSION}.jar" \ 6 | -o /opt/prometheus/jmx_prometheus_javaagent.jar \ 7 | && chmod 444 /opt/prometheus/jmx_prometheus_javaagent.jar \ 8 | && chmod 555 /opt/prometheus/conf 9 | 10 | ENV KAFKA_OPTS="-javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=5555:/opt/prometheus/conf/prometheus-config.yml" 11 | 12 | ADD prometheus-config.yml /opt/prometheus/conf/ 13 | -------------------------------------------------------------------------------- /openshift/kafka/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM confluentinc/cp-kafka:5.0.0 2 | 3 | ENV PROMETHEUS_EXPORTER_VERSION=0.3.1 4 | RUN mkdir -p /opt/prometheus/conf \ 5 | && curl -SLs "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${PROMETHEUS_EXPORTER_VERSION}/jmx_prometheus_javaagent-${PROMETHEUS_EXPORTER_VERSION}.jar" \ 6 | -o /opt/prometheus/jmx_prometheus_javaagent.jar \ 7 | && chmod 444 /opt/prometheus/jmx_prometheus_javaagent.jar \ 8 | && chmod 555 /opt/prometheus/conf 9 | 10 | ENV KAFKA_OPTS="-javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=5555:/opt/prometheus/conf/prometheus-config.yml" 11 | 12 | ADD prometheus-config.yml /opt/prometheus/conf/ 13 | -------------------------------------------------------------------------------- /openshift/zookeeper/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM confluentinc/cp-zookeeper:5.0.0 2 | 3 | ENV PROMETHEUS_EXPORTER_VERSION=0.3.1 4 | RUN mkdir -p /opt/prometheus/conf \ 5 | && curl -SLs "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${PROMETHEUS_EXPORTER_VERSION}/jmx_prometheus_javaagent-${PROMETHEUS_EXPORTER_VERSION}.jar" \ 6 | -o /opt/prometheus/jmx_prometheus_javaagent.jar \ 7 | && chmod 444 /opt/prometheus/jmx_prometheus_javaagent.jar \ 8 | && chmod 555 /opt/prometheus/conf 9 | 10 | ENV KAFKA_OPTS="-javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=5555:/opt/prometheus/conf/prometheus-config.yml" 11 | 12 | ADD prometheus-config.yml /opt/prometheus/conf/ 13 | -------------------------------------------------------------------------------- /k8s/zookeeper/prometheus-config.yml: -------------------------------------------------------------------------------- 1 | rules: 2 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 3 | name: "zookeeper_$2" 4 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 5 | name: "zookeeper_$3" 6 | labels: 7 | replicaId: "$2" 8 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 9 | name: "zookeeper_$4" 10 | labels: 11 | replicaId: "$2" 12 | memberType: "$3" 13 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 14 | name: "zookeeper_$4_$5" 15 | labels: 16 | replicaId: "$2" 17 | memberType: "$3" 18 | -------------------------------------------------------------------------------- /openshift/zookeeper/prometheus-config.yml: -------------------------------------------------------------------------------- 1 | rules: 2 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 3 | name: "zookeeper_$2" 4 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 5 | name: "zookeeper_$3" 6 | labels: 7 | replicaId: "$2" 8 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 9 | name: "zookeeper_$4" 10 | labels: 11 | replicaId: "$2" 12 | memberType: "$3" 13 | - pattern: "org.apache.ZooKeeperService<>(\\w+)" 14 | name: "zookeeper_$4_$5" 15 | labels: 16 | replicaId: "$2" 17 | memberType: "$3" 18 | -------------------------------------------------------------------------------- /burrow-dashboard.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: kafka-burrow 5 | namespace: kafka-confluent-5 6 | labels: 7 | app: kafka-burrow 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: kafka-burrow 13 | template: 14 | metadata: 15 | labels: 16 | app: kafka-burrow 17 | spec: 18 | imagePullSecrets: 19 | - name: docker.in 20 | containers: 21 | - name: kafka-burrow 22 | image: joway/docker-burrow 23 | env: 24 | - name: ZOOKEEPER_SERVERS 25 | value: '"zoo-0.zookeeper.kafka-confluent-5.svc.cluster.local:2181;zoo-1.zookeeper.kafka-confluent-5.svc.cluster.local:2181;zoo-2.zookeeper.kafka-confluent-5.svc.cluster.local:2181' 26 | - name: KAFKA_BROKERS 27 | value: '"kafka-0.kafka.kafka-confluent-5.svc.cluster.local:9092;kafka-1.kafka.kafka-confluent-5.svc.cluster.local:9092;kafka-2.kafka.kafka-confluent-5.svc.cluster.local:9092"' 28 | - name: KAFKA_VERSION 29 | value: 0.10.1.0 30 | ports: 31 | - containerPort: 8000 32 | name: api 33 | protocol: TCP 34 | - name: kafka-burrow-dashboard 35 | image: joway/burrow-dashboard:latest 36 | env: 37 | - name: BURROW_BACKEND 38 | value: "http://kafka-burrow-svc:8000" 39 | ports: 40 | - containerPort: 80 41 | name: web 42 | protocol: TCP 43 | --- 44 | apiVersion: v1 45 | kind: Service 46 | metadata: 47 | name: kafka-burrow-svc 48 | namespace: kafka-confluent-5 49 | labels: 50 | app: kafka-burrow 51 | spec: 52 | ports: 53 | - port: 8000 54 | name: api 55 | targetPort: 8000 56 | - port: 80 57 | name: web 58 | targetPort: 80 59 | selector: 60 | app: kafka-burrow 61 | -------------------------------------------------------------------------------- /k8s/kafka/prometheus-config.yml: -------------------------------------------------------------------------------- 1 | lowercaseOutputName: true 2 | rules: 3 | - pattern : kafka.cluster<>Value 4 | name: kafka_cluster_$1_$2 5 | labels: 6 | topic: "$3" 7 | partition: "$4" 8 | - pattern : kafka.log<>Value 9 | name: kafka_log_$1 10 | labels: 11 | topic: "$2" 12 | partition: "$3" 13 | - pattern : kafka.controller<>(Count|Value) 14 | name: kafka_controller_$1_$2 15 | - pattern : kafka.network<>Value 16 | name: kafka_network_$1_$2 17 | - pattern : kafka.network<>Count 18 | name: kafka_network_$1_$2_total 19 | labels: 20 | request: "$3" 21 | - pattern : kafka.network<>Count 22 | name: kafka_network_$1_$2 23 | labels: 24 | request: "$3" 25 | type: COUNTER 26 | - pattern : kafka.network<>Count 27 | name: kafka_network_$1_$2 28 | labels: 29 | request: "$3" 30 | - pattern : kafka.network<>Count 31 | name: kafka_network_$1_$2 32 | - pattern : kafka.server<>Count 33 | name: kafka_server_$1_$2_total 34 | labels: 35 | topic: "$3" 36 | - pattern : kafka.server<>Count 37 | name: kafka_server_$1_$2_total 38 | type: COUNTER 39 | 40 | - pattern : kafka.server<>(Count|Value) 41 | name: kafka_server_$1_$2 42 | labels: 43 | clientId: "$3" 44 | topic: "$4" 45 | partition: "$5" 46 | - pattern : kafka.server<>(Count|Value) 47 | name: kafka_server_$1_$2 48 | labels: 49 | topic: "$3" 50 | partition: "$4" 51 | - pattern : kafka.server<>(Count|Value) 52 | name: kafka_server_$1_$2 53 | labels: 54 | topic: "$3" 55 | type: COUNTER 56 | 57 | - pattern : kafka.server<>(Count|Value) 58 | name: kafka_server_$1_$2 59 | labels: 60 | clientId: "$3" 61 | broker: "$4:$5" 62 | - pattern : kafka.server<>(Count|Value) 63 | name: kafka_server_$1_$2 64 | labels: 65 | clientId: "$3" 66 | - pattern : kafka.server<>(Count|Value) 67 | name: kafka_server_$1_$2 68 | 69 | - pattern : kafka.(\w+)<>Count 70 | name: kafka_$1_$2_$3_total 71 | - pattern : kafka.(\w+)<>Count 72 | name: kafka_$1_$2_$3_total 73 | labels: 74 | topic: "$4" 75 | type: COUNTER 76 | - pattern : kafka.(\w+)<>Count 77 | name: kafka_$1_$2_$3_total 78 | labels: 79 | topic: "$4" 80 | partition: "$5" 81 | type: COUNTER 82 | - pattern : kafka.(\w+)<>(Count|Value) 83 | name: kafka_$1_$2_$3_$4 84 | type: COUNTER 85 | - pattern : kafka.(\w+)<>(Count|Value) 86 | name: kafka_$1_$2_$3_$6 87 | labels: 88 | "$4": "$5" 89 | -------------------------------------------------------------------------------- /openshift/kafka/prometheus-config.yml: -------------------------------------------------------------------------------- 1 | lowercaseOutputName: true 2 | rules: 3 | - pattern : kafka.cluster<>Value 4 | name: kafka_cluster_$1_$2 5 | labels: 6 | topic: "$3" 7 | partition: "$4" 8 | - pattern : kafka.log<>Value 9 | name: kafka_log_$1 10 | labels: 11 | topic: "$2" 12 | partition: "$3" 13 | - pattern : kafka.controller<>(Count|Value) 14 | name: kafka_controller_$1_$2 15 | - pattern : kafka.network<>Value 16 | name: kafka_network_$1_$2 17 | - pattern : kafka.network<>Count 18 | name: kafka_network_$1_$2_total 19 | labels: 20 | request: "$3" 21 | - pattern : kafka.network<>Count 22 | name: kafka_network_$1_$2 23 | labels: 24 | request: "$3" 25 | type: COUNTER 26 | - pattern : kafka.network<>Count 27 | name: kafka_network_$1_$2 28 | labels: 29 | request: "$3" 30 | - pattern : kafka.network<>Count 31 | name: kafka_network_$1_$2 32 | - pattern : kafka.server<>Count 33 | name: kafka_server_$1_$2_total 34 | labels: 35 | topic: "$3" 36 | - pattern : kafka.server<>Count 37 | name: kafka_server_$1_$2_total 38 | type: COUNTER 39 | 40 | - pattern : kafka.server<>(Count|Value) 41 | name: kafka_server_$1_$2 42 | labels: 43 | clientId: "$3" 44 | topic: "$4" 45 | partition: "$5" 46 | - pattern : kafka.server<>(Count|Value) 47 | name: kafka_server_$1_$2 48 | labels: 49 | topic: "$3" 50 | partition: "$4" 51 | - pattern : kafka.server<>(Count|Value) 52 | name: kafka_server_$1_$2 53 | labels: 54 | topic: "$3" 55 | type: COUNTER 56 | 57 | - pattern : kafka.server<>(Count|Value) 58 | name: kafka_server_$1_$2 59 | labels: 60 | clientId: "$3" 61 | broker: "$4:$5" 62 | - pattern : kafka.server<>(Count|Value) 63 | name: kafka_server_$1_$2 64 | labels: 65 | clientId: "$3" 66 | - pattern : kafka.server<>(Count|Value) 67 | name: kafka_server_$1_$2 68 | 69 | - pattern : kafka.(\w+)<>Count 70 | name: kafka_$1_$2_$3_total 71 | - pattern : kafka.(\w+)<>Count 72 | name: kafka_$1_$2_$3_total 73 | labels: 74 | topic: "$4" 75 | type: COUNTER 76 | - pattern : kafka.(\w+)<>Count 77 | name: kafka_$1_$2_$3_total 78 | labels: 79 | topic: "$4" 80 | partition: "$5" 81 | type: COUNTER 82 | - pattern : kafka.(\w+)<>(Count|Value) 83 | name: kafka_$1_$2_$3_$4 84 | type: COUNTER 85 | - pattern : kafka.(\w+)<>(Count|Value) 86 | name: kafka_$1_$2_$3_$6 87 | labels: 88 | "$4": "$5" 89 | -------------------------------------------------------------------------------- /kafkacat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: ConfigMap 3 | metadata: 4 | name: kafkacat 5 | namespace: kafka-confluent-5 6 | apiVersion: v1 7 | data: 8 | 9 | setup.sh: |- 10 | touch /tmp/testlog 11 | 12 | tail -f /tmp/testlog 13 | 14 | test.sh: |- 15 | exec >> /tmp/testlog 16 | exec 2>&1 17 | 18 | PC_WAIT=.2 19 | MAX_AGE=5 20 | 21 | UNIQUE="${HOSTNAME}@$(date -u -Ins)" 22 | 23 | echo "${UNIQUE: -41:5}:Test $UNIQUE" >> /shared/produce.tmp 24 | sleep $PC_WAIT 25 | LAST=$(tail -n 1 /shared/consumed.tmp) 26 | [ -z "$LAST" ] && echo "Nothing consumed" && exit 1 27 | 28 | LAST_TS=$(echo $LAST | awk -F';' '{print $1}') 29 | [ -z "$LAST_TS" ] && echo "Failed to get timestamp for message: $LAST" && exit 1 30 | LAST_MSG=$(echo $LAST | awk -F';' '{print $4}') 31 | NOW=$(date -u +%s%3N) 32 | DIFF_S=$((($NOW - $LAST_TS)/1000)) 33 | DIFF_MS=$((($NOW - $LAST_TS)%1000)) 34 | #echo "$NOW ($(date +%FT%H:%M:%S.%3N)):" 35 | #echo "$LAST_TS" 36 | 37 | if [ $DIFF_S -gt $MAX_AGE ]; then 38 | echo "Last message is $DIFF_S.$DIFF_MS old:" 39 | echo "$LAST_MSG" 40 | exit 10 41 | fi 42 | 43 | if [[ "$LAST_MSG" != *"$UNIQUE" ]]; then 44 | echo "Last message (at $LAST_TS) isn't from this test run ($UNIQUE):" 45 | echo "$LAST_MSG" 46 | exit 11 47 | fi 48 | 49 | # get info about this message 50 | kafkacat -Q -b $BOOTSTRAP -t test-kafkacat:0:$LAST_TS \ 51 | -X socket.timeout.ms=600 -X session.timeout.ms=300 -X request.timeout.ms=50 -X metadata.request.timeout.ms=600 52 | [ $? -eq 0 ] || echo "At $(date +%FT%H:%M:%S.%3N) bootstrap broker(s) might be down" 53 | # but don't fail the test; producer and consumer should keep going if there are other brokers 54 | 55 | # We haven't asserted that the consumer works, so we'll just have to assume that it will exit if it fails 56 | 57 | exit 0 58 | 59 | quit-on-nonzero-exit.sh: |- 60 | exec >> /tmp/testlog 61 | exec 2>&1 62 | 63 | exit 0 64 | --- 65 | apiVersion: batch/v1 66 | kind: Job 67 | metadata: 68 | name: topic-test-kafkacat 69 | namespace: kafka-confluent-5 70 | spec: 71 | template: 72 | spec: 73 | containers: 74 | - name: topic-create 75 | image: solsson/kafka:1.0.2@sha256:7fdb326994bcde133c777d888d06863b7c1a0e80f043582816715d76643ab789 76 | command: 77 | - ./bin/kafka-topics.sh 78 | - --zookeeper 79 | - zookeeper.kafka-confluent-5.svc.cluster.local:2181 80 | - --create 81 | - --if-not-exists 82 | - --topic 83 | - test-kafkacat 84 | - --partitions 85 | - "1" 86 | - --replication-factor 87 | - "3" 88 | restartPolicy: Never 89 | --- 90 | apiVersion: apps/v1beta2 91 | kind: ReplicaSet 92 | metadata: 93 | name: kafkacat 94 | namespace: kafka-confluent-5 95 | spec: 96 | # Note that this test sets a consumer group, but asserts assume that the tests gets its own messages 97 | replicas: 1 98 | selector: 99 | matchLabels: 100 | test-target: kafka-client-kafkacat 101 | test-type: readiness 102 | template: 103 | metadata: 104 | labels: 105 | test-target: kafka-client-kafkacat 106 | test-type: readiness 107 | spec: 108 | containers: 109 | - name: producer 110 | image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9 111 | env: 112 | - name: BOOTSTRAP 113 | value: kafka:9092 114 | command: 115 | - /bin/bash 116 | - -cex 117 | - > 118 | echo "--- start $HOSTNAME $(date --iso-8601='ns' -u) ---" >> /shared/produce.tmp 119 | ; 120 | tail -f /shared/produce.tmp | 121 | kafkacat -P -b $BOOTSTRAP -t test-kafkacat -v -T -d broker -K ':' 122 | ; 123 | volumeMounts: 124 | - name: config 125 | mountPath: /test 126 | - name: shared 127 | mountPath: /shared 128 | - name: consumer 129 | image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9 130 | env: 131 | - name: BOOTSTRAP 132 | value: kafka:9092 133 | - name: CONSUMER_GROUP_ID 134 | value: test-kafkacat-group 135 | command: 136 | - /bin/bash 137 | - -cex 138 | - > 139 | kafkacat -b $BOOTSTRAP -G $CONSUMER_GROUP_ID test-kafkacat -o -1 -f '%T;%k:%p;%o;%s\n' -u -d broker | 140 | tee /shared/consumed.tmp 141 | ; 142 | volumeMounts: 143 | - name: config 144 | mountPath: /test 145 | - name: shared 146 | mountPath: /shared 147 | - name: testcase 148 | image: solsson/kafkacat@sha256:b32eedf936f3cde44cd164ddc77dfcf7565a8af4e357ff6de1abe4389ca530c9 149 | env: 150 | - name: BOOTSTRAP 151 | value: kafka:9092 152 | command: 153 | - /bin/bash 154 | - -e 155 | - /test/setup.sh 156 | readinessProbe: 157 | exec: 158 | command: 159 | - /bin/bash 160 | - -e 161 | - /test/test.sh 162 | initialDelaySeconds: 10 163 | periodSeconds: 10 164 | livenessProbe: 165 | exec: 166 | command: 167 | - /bin/bash 168 | - -e 169 | - /test/quit-on-nonzero-exit.sh 170 | volumeMounts: 171 | - name: config 172 | mountPath: /test 173 | - name: shared 174 | mountPath: /shared 175 | volumes: 176 | - name: config 177 | configMap: 178 | name: kafkacat 179 | - name: shared 180 | emptyDir: {} 181 | -------------------------------------------------------------------------------- /k8s/streaming-ephemeral.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | items: 3 | - apiVersion: v1 4 | kind: Service 5 | metadata: 6 | labels: 7 | app: kafka 8 | component: zookeeper 9 | name: zoo 10 | spec: 11 | clusterIP: None 12 | ports: 13 | - name: peer 14 | port: 2888 15 | - name: leader-election 16 | port: 3888 17 | selector: 18 | app: kafka 19 | component: zookeeper 20 | - apiVersion: v1 21 | kind: Service 22 | metadata: 23 | labels: 24 | app: kafka 25 | component: zookeeper 26 | name: zookeeper 27 | spec: 28 | ports: 29 | - name: client 30 | port: 2181 31 | selector: 32 | app: kafka 33 | component: zookeeper 34 | - apiVersion: apps/v1 35 | kind: StatefulSet 36 | metadata: 37 | labels: 38 | app: kafka 39 | component: zookeeper 40 | name: zoo 41 | spec: 42 | selector: 43 | matchLabels: 44 | app: kafka 45 | component: zookeeper 46 | replicas: 3 47 | serviceName: zoo 48 | template: 49 | metadata: 50 | annotations: 51 | prometheus.io/path: /metrics 52 | prometheus.io/port: "5555" 53 | prometheus.io/scrape: "true" 54 | labels: 55 | app: kafka 56 | component: zookeeper 57 | spec: 58 | terminationGracePeriodSeconds: 10 59 | containers: 60 | - name: zookeeper 61 | image: 'confluentinc/cp-zookeeper:5.0.0' 62 | env: 63 | - name: KAFKA_HEAP_OPTS 64 | value: '-Xms512M -Xmx512M' 65 | - name: ZOOKEEPER_TICK_TIME 66 | value: '2000' 67 | - name: ZOOKEEPER_SYNC_LIMIT 68 | value: '5' 69 | - name: ZOOKEEPER_INIT_LIMIT 70 | value: '10' 71 | - name: ZOOKEEPER_MAX_CLIENT_CNXNS 72 | value: '60' 73 | - name: ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT 74 | value: '3' 75 | - name: ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL 76 | value: '24' 77 | - name: ZOOKEEPER_CLIENT_PORT 78 | value: '2181' 79 | - name: ZOOKEEPER_SERVER_ID 80 | valueFrom: 81 | fieldRef: 82 | apiVersion: v1 83 | fieldPath: metadata.name 84 | - name: ZOOKEEPER_SERVERS 85 | value: >- 86 | zoo-0.zoo.kafka-confluent-5.svc.cluster.local:2888:3888;zoo-1.zoo.kafka-confluent-5.svc.cluster.local:2888:3888;zoo-2.zoo.kafka-confluent-5.svc.cluster.local:2888:3888 87 | ports: 88 | - containerPort: 2181 89 | name: client 90 | - containerPort: 2888 91 | name: peer 92 | - containerPort: 3888 93 | name: leader-election 94 | volumeMounts: 95 | - name: datadir 96 | mountPath: /var/lib/zookeeper/data 97 | # Set Zookeeper Server ID by fetching the hostname (hostname is of the form `zookeeper-0`, `zookeeper-1`, … 98 | command: 99 | - /bin/bash 100 | - -c 101 | - export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) && /etc/confluent/docker/run 102 | volumes: 103 | - name: datadir 104 | emptyDir: {} 105 | - apiVersion: v1 106 | kind: Service 107 | metadata: 108 | labels: 109 | app: kafka 110 | component: kafka-broker 111 | name: broker 112 | spec: 113 | clusterIP: None 114 | ports: 115 | - port: 9092 116 | selector: 117 | app: kafka 118 | component: kafka-broker 119 | - apiVersion: v1 120 | kind: Service 121 | metadata: 122 | labels: 123 | app: kafka 124 | component: kafka-broker 125 | name: kafka 126 | spec: 127 | ports: 128 | - port: 9092 129 | selector: 130 | app: kafka 131 | component: kafka-broker 132 | - apiVersion: apps/v1 133 | kind: StatefulSet 134 | metadata: 135 | labels: 136 | app: kafka 137 | component: kafka-broker 138 | name: kafka 139 | spec: 140 | selector: 141 | matchLabels: 142 | app: kafka 143 | replicas: 3 144 | serviceName: broker 145 | template: 146 | metadata: 147 | annotations: 148 | prometheus.io/path: /metrics 149 | prometheus.io/port: "5555" 150 | prometheus.io/scrape: "true" 151 | labels: 152 | app: kafka 153 | component: kafka-broker 154 | spec: 155 | terminationGracePeriodSeconds: 10 156 | containers: 157 | - name: broker 158 | image: 'kubernautslabs/cp-kafka:5.0.0' 159 | env: 160 | - name: POD_IP 161 | valueFrom: 162 | fieldRef: 163 | apiVersion: v1 164 | fieldPath: status.podIP 165 | - name: HOST_IP 166 | valueFrom: 167 | fieldRef: 168 | apiVersion: v1 169 | fieldPath: status.hostIP 170 | - name: KAFKA_ADVERTISED_LISTENERS 171 | value: 'EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID}))' 172 | - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP 173 | value: 'PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT' 174 | - name: KAFKA_HEAP_OPTS 175 | value: '-Xmx2G' 176 | - name: KAFKA_ZOOKEEPER_CONNECT 177 | value: zoo 178 | - name: KAFKA_LOG_DIRS 179 | value: /var/lib/kafka/data 180 | - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR 181 | value: '3' 182 | - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR 183 | value: '3' 184 | - name: KAFKA_OPTS 185 | value: "-javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=5555:/opt/prometheus/conf/prometheus-config.yml" 186 | ports: 187 | - containerPort: 9092 188 | name: kafka 189 | - containerPort: 5555 190 | name: prometheus 191 | volumeMounts: 192 | - name: datadir 193 | mountPath: /var/lib/kafka/data 194 | command: 195 | - sh 196 | - -exc 197 | - | 198 | unset KAFKA_PORT && export KAFKA_BROKER_ID=${HOSTNAME##*-} && \ 199 | export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_IP}:9092,EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID})) && \ 200 | exec /etc/confluent/docker/run 201 | volumes: 202 | - name: datadir 203 | emptyDir: {} 204 | kind: List 205 | metadata: {} -------------------------------------------------------------------------------- /k8s/streaming-persistent-aws-ebs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | items: 3 | - apiVersion: v1 4 | kind: Service 5 | metadata: 6 | labels: 7 | app: kafka 8 | component: zookeeper 9 | name: zoo 10 | spec: 11 | clusterIP: None 12 | ports: 13 | - name: peer 14 | port: 2888 15 | - name: leader-election 16 | port: 3888 17 | selector: 18 | app: kafka 19 | component: zookeeper 20 | - apiVersion: v1 21 | kind: Service 22 | metadata: 23 | labels: 24 | app: kafka 25 | component: zookeeper 26 | name: zookeeper 27 | spec: 28 | ports: 29 | - name: client 30 | port: 2181 31 | selector: 32 | app: kafka 33 | component: zookeeper 34 | - apiVersion: apps/v1 35 | kind: StatefulSet 36 | metadata: 37 | labels: 38 | app: kafka 39 | component: zookeeper 40 | name: zoo 41 | spec: 42 | selector: 43 | matchLabels: 44 | app: kafka 45 | component: zookeeper 46 | replicas: 3 47 | serviceName: zoo 48 | template: 49 | metadata: 50 | annotations: 51 | prometheus.io/path: /metrics 52 | prometheus.io/port: "5555" 53 | prometheus.io/scrape: "true" 54 | labels: 55 | app: kafka 56 | component: zookeeper 57 | spec: 58 | terminationGracePeriodSeconds: 10 59 | containers: 60 | - name: zookeeper 61 | image: 'confluentinc/cp-zookeeper:5.0.0' 62 | env: 63 | - name: KAFKA_HEAP_OPTS 64 | value: '-Xms512M -Xmx512M' 65 | - name: ZOOKEEPER_TICK_TIME 66 | value: '2000' 67 | - name: ZOOKEEPER_SYNC_LIMIT 68 | value: '5' 69 | - name: ZOOKEEPER_INIT_LIMIT 70 | value: '10' 71 | - name: ZOOKEEPER_MAX_CLIENT_CNXNS 72 | value: '60' 73 | - name: ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT 74 | value: '3' 75 | - name: ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL 76 | value: '24' 77 | - name: ZOOKEEPER_CLIENT_PORT 78 | value: '2181' 79 | - name: ZOOKEEPER_SERVER_ID 80 | valueFrom: 81 | fieldRef: 82 | apiVersion: v1 83 | fieldPath: metadata.name 84 | - name: ZOOKEEPER_SERVERS 85 | value: >- 86 | zoo-0.zoo.kafka-confluent-5.svc.cluster.local:2888:3888;zoo-1.zoo.kafka-confluent-5.svc.cluster.local:2888:3888;zoo-2.zoo.kafka-confluent-5.svc.cluster.local:2888:3888 87 | ports: 88 | - containerPort: 2181 89 | name: client 90 | - containerPort: 2888 91 | name: peer 92 | - containerPort: 3888 93 | name: leader-election 94 | volumeMounts: 95 | - name: datadir 96 | mountPath: /var/lib/zookeeper/data 97 | # Set Zookeeper Server ID by fetching the hostname (hostname is of the form `zookeeper-0`, `zookeeper-1`, … 98 | command: 99 | - /bin/bash 100 | - -c 101 | - export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) && /etc/confluent/docker/run 102 | volumes: 103 | - name: datadir 104 | emptyDir: {} 105 | volumeClaimTemplates: 106 | - metadata: 107 | name: datadir 108 | labels: 109 | app: kafka 110 | component: zookeeper 111 | annotations: 112 | volume.beta.kubernetes.io/storage-class: gp2 113 | spec: 114 | accessModes: 115 | - ReadWriteOnce 116 | resources: 117 | requests: 118 | storage: 1Gi 119 | - apiVersion: v1 120 | kind: Service 121 | metadata: 122 | labels: 123 | app: kafka 124 | component: kafka-broker 125 | name: broker 126 | spec: 127 | clusterIP: None 128 | ports: 129 | - port: 9092 130 | selector: 131 | app: kafka 132 | component: kafka-broker 133 | - apiVersion: v1 134 | kind: Service 135 | metadata: 136 | labels: 137 | app: kafka 138 | component: kafka-broker 139 | name: kafka 140 | spec: 141 | ports: 142 | - port: 9092 143 | selector: 144 | app: kafka 145 | component: kafka-broker 146 | - apiVersion: apps/v1 147 | kind: StatefulSet 148 | metadata: 149 | labels: 150 | app: kafka 151 | component: kafka-broker 152 | name: kafka 153 | spec: 154 | selector: 155 | matchLabels: 156 | app: kafka 157 | replicas: 3 158 | serviceName: broker 159 | template: 160 | metadata: 161 | annotations: 162 | prometheus.io/path: /metrics 163 | prometheus.io/port: "5555" 164 | prometheus.io/scrape: "true" 165 | labels: 166 | app: kafka 167 | component: kafka-broker 168 | spec: 169 | terminationGracePeriodSeconds: 10 170 | containers: 171 | - name: broker 172 | image: 'kubernautslabs/cp-kafka:5.0.0' 173 | env: 174 | - name: POD_IP 175 | valueFrom: 176 | fieldRef: 177 | apiVersion: v1 178 | fieldPath: status.podIP 179 | - name: HOST_IP 180 | valueFrom: 181 | fieldRef: 182 | apiVersion: v1 183 | fieldPath: status.hostIP 184 | - name: KAFKA_ADVERTISED_LISTENERS 185 | value: 'EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID}))' 186 | - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP 187 | value: 'PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT' 188 | - name: KAFKA_HEAP_OPTS 189 | value: '-Xmx2G' 190 | - name: KAFKA_ZOOKEEPER_CONNECT 191 | value: zoo 192 | - name: KAFKA_LOG_DIRS 193 | value: /opt/kafka/data/logs 194 | - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR 195 | value: '3' 196 | - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR 197 | value: '3' 198 | - name: KAFKA_OPTS 199 | value: "-javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=5555:/opt/prometheus/conf/prometheus-config.yml" 200 | ports: 201 | - containerPort: 9092 202 | name: kafka 203 | - containerPort: 5555 204 | name: prometheus 205 | volumeMounts: 206 | - name: datadir 207 | mountPath: /opt/kafka/data 208 | command: 209 | - sh 210 | - -exc 211 | - | 212 | unset KAFKA_PORT && export KAFKA_BROKER_ID=${HOSTNAME##*-} && \ 213 | export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_IP}:9092,EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID})) && \ 214 | exec /etc/confluent/docker/run 215 | volumes: 216 | - name: datadir 217 | emptyDir: {} 218 | volumeClaimTemplates: 219 | - metadata: 220 | name: datadir 221 | labels: 222 | app: kafka 223 | component: kafka-broker 224 | annotations: 225 | volume.beta.kubernetes.io/storage-class: gp2 226 | spec: 227 | accessModes: 228 | - ReadWriteOnce 229 | resources: 230 | requests: 231 | storage: 1Gi 232 | kind: List 233 | metadata: {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apache Kafka® Confluent Platform on Kubernetes and OpenShift 2 | 3 | This repo provides docker files, k8s manifests and OpenShift templates for Apache Kafka® Confluent Platform Community Edition. The reason why we're not using helm charts or the kafka operator at this time is because we like plain manifests which are more suitable for the learning phase. 4 | 5 | ## Prerequisites 6 | 7 | This implementation was developed and tested on EKS with k8s 1.10.3, with tk8 made k8s 1.11.2 and OpenShift 3.5 and 3.7. 8 | If one would like to get it working on k8s < 1.9.x, the `apiVersion` for StatefulSets should be changed to `apps/v1beta1` or `apps/v1beta2` instead of `apps/v1`. 9 | 10 | ## Quick start ephemeral 11 | 12 | To deploy the ephemeral version for development create the kafka-confluent-5 namespace and deploy the kafka-broker, zookeeper and the related services as follow: 13 | 14 | ```bash 15 | $ kubectl create ns kafka-confluent-5 16 | $ kubectl create -f https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/master/k8s/streaming-ephemeral.yaml -n kafka-confluent-5 17 | ``` 18 | 19 | ```bash 20 | $ kubectl get pods 21 | NAME READY STATUS RESTARTS AGE 22 | kafka-0 1/1 Running 0 1m 23 | kafka-1 1/1 Running 0 1m 24 | kafka-2 1/1 Running 0 1m 25 | zoo-0 1/1 Running 0 1m 26 | zoo-1 1/1 Running 0 1m 27 | zoo-2 1/1 Running 0 1m 28 | ``` 29 | 30 | ## Quick start persistent 31 | 32 | To deploy the persistent version with PVCs, create the kafka-confluent-5 namespace, create the storage class gp2 (for aws-ebs here) and deploy the kafka-broker, zookeeper and the related services with persitent support as follow: 33 | 34 | Please adapt the zone in the storage class where you've your k8s cluster: 35 | 36 | ```bash 37 | apiVersion: storage.k8s.io/v1 38 | kind: StorageClass 39 | metadata: 40 | name: gp2 41 | annotations: 42 | storageclass.kubernetes.io/is-default-class: "true" 43 | labels: 44 | kubernetes.io/cluster-service: "true" 45 | provisioner: kubernetes.io/aws-ebs 46 | parameters: 47 | type: gp2 48 | zone: "us-east-1a" 49 | ``` 50 | 51 | And run the follwoing commads: 52 | 53 | ```bash 54 | $ kubectl create ns kafka-confluent-5 55 | $ kubectl create -f https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/master/k8s/storageclass-aws-ebs.yaml 56 | $ kubectl create -f https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/master/k8s/streaming-persistent-aws-ebs.yaml -n kafka-confluent-5 57 | ``` 58 | 59 | ## Qucik start OpenShift 60 | 61 | For OpenShift 3.5 create a project "kafka-confluent-5" in OpenShift and upload the template through OpenShift Webcosole: 62 | 63 | https://raw.githubusercontent.com/kubernauts/kafka-confluent-platform/master/openshift/streaming-template-confluent-persistenti-gluster.yaml 64 | 65 | ## Testing with Confluent Test Client 66 | 67 | Deploy confluent test-client 68 | 69 | ```bash 70 | kubectl create -f confluent-testclient-confluent-5.yaml 71 | ``` 72 | 73 | ### Create topics 74 | 75 | ```bash 76 | kubectl exec -it confluent-client -- /usr/bin/kafka-topics --zookeeper zoo --topic topic1 --create --partitions 30 --replication-factor 3 77 | ``` 78 | 79 | ### List topics 80 | 81 | ```bash 82 | kubectl exec -it confluent-client -- /usr/bin/kafka-topics --zookeeper zookeeper:2181 --list 83 | ``` 84 | 85 | ### Describe topics 86 | 87 | ```bash 88 | kubectl exec -it confluent-client -- /usr/bin/kafka-topics --zookeeper zookeeper:2181 --describe 89 | ``` 90 | 91 | ### Produce messages 92 | 93 | ```bash 94 | kubectl exec -it confluent-client -- /usr/bin/kafka-console-producer --broker-list broker:9092 --topic topic1 95 | ``` 96 | 97 | ### Consume messages 98 | 99 | ```bash 100 | kubectl exec -it confluent-client -- /usr/bin/kafka-console-consumer --bootstrap-server broker:9092 --topic topic1 --from-beginning 101 | ``` 102 | 103 | ### Delete topic 104 | 105 | ```bash 106 | kubectl exec -it confluent-client -- /usr/bin/kafka-topics --zookeeper zookeeper:2181 --delete --topic topic1 107 | ``` 108 | 109 | ### Testing with Kafkacat 110 | 111 | Deploy Kafkacat: 112 | 113 | ```bash 114 | kubectl create -f kafkacat.yml 115 | ``` 116 | 117 | Exec into the producer container and write messages to topic1: 118 | 119 | ```bash 120 | $ k exec -it kafkacat-12345 -c producer /bin/bash 121 | $ for i in `seq 1 100`; do echo "hello kafka world" | kafkacat -b kafka:9092 -t topic1; done 122 | ``` 123 | 124 | In another shell exec into the cosumer container and read messages: 125 | 126 | ```bash 127 | $ k exec -it kafkacat-12345 -c consumer /bin/bash 128 | # kafkacat -C -b kafka:9092 -t topic1 129 | ``` 130 | 131 | ## Deploy Yahoo Kafka Manager with Helm 132 | 133 | Make sure your k8s cluster is properly configured for Helm: 134 | 135 | ```bash 136 | helm init 137 | kubectl create serviceaccount --namespace kube-system tiller 138 | kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller 139 | kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' 140 | ``` 141 | 142 | Clone the great implementation of Charles Martinot for the Yahoo Kafka Manager: 143 | 144 | ```bash 145 | $ git clone https://github.com/MacTynow/kafka-manager-chart.git 146 | $ cd kafka-manager-chart 147 | ``` 148 | 149 | Adapt values.yaml 150 | 151 | ```bash 152 | useKafkaZookeeper: true 153 | zkHosts: "zoo" 154 | ``` 155 | 156 | Install Yahoo Kafka Manager with Helm: 157 | 158 | ```bash 159 | $ helm install . 160 | ``` 161 | 162 | Follow the instructions of the helm output, and access the GUI, provide "zoo" as the Cluster Zookeeper Hosts (the headless service). 163 | 164 | ## Rancher integration 165 | 166 | Deploy Rancher on your k8s cluster with a single command: 167 | 168 | ```bash 169 | kubectl create -f https://raw.githubusercontent.com/kubernauts/tk8/master/addons/rancher/master.yaml 170 | ``` 171 | 172 | Rancher will be up in 2 minutes, you can get the LB address through: 173 | 174 | ```bash 175 | $ kubectl get svc -n cattle-system 176 | ``` 177 | 178 | Add a project in Rancher by navigating to "Projects/Namespaces" in Rancher UI, e.g. "confluent-kafka-5-project" and move the namespace "confluent-kafka-5" namespace to the newly created project "confluent-kafka-5-project". With this you can add new users to the project and have control! 179 | 180 | ## Monitoring and Alerting with Prometheus and Grafana through Rancher 181 | 182 | Select your newly created project "confluent-kafka-5-project", navigate to Catalog Apps in the nice menu bar of Rancher and add Prometheus from Rancher's Library Catalog with the follwoing settings: 183 | 184 | ### PROMETHEUS SERVER 185 | 186 | ```bash 187 | Expose Prometheus using Layer 7 Load Balancer: false 188 | Prometheus Service Type: ClusterIP 189 | Prometheus Persistent Volume StorageClass: gp2 (whic was created through the storageclass on EKS) 190 | Create Persistent Volume for Prometheus: true 191 | ``` 192 | 193 | ### GRAFANA SETTINGS 194 | 195 | ```bash 196 | Expose Grafana using Layer 7 Load Balancer: false 197 | Grafana Service Type: NodePort 198 | Grafana Persistent Volume Enabled: true 199 | Storage Class for Grafana: gp2 200 | ``` 201 | ### ALERTMANAGER 202 | 203 | ```bash 204 | Expose Alertmanager using Layer 7 Load Balancer: false 205 | Alertmanager Service Type: ClusterIP 206 | Create Persistent Volume for Alertmanager: true 207 | Alertmanager Persistent Volume StorageClass: gp2 208 | ``` 209 | 210 | And click on launch, after 2 minutes you shall get: 211 | 212 | ```bash 213 | $ k get pods -n prometheus 214 | NAME READY STATUS RESTARTS AGE 215 | prometheus-alertmanager-6df98765f4-f79kh 2/2 Running 0 3m 216 | prometheus-grafana-5bf7b6d949-pldn7 2/2 Running 0 3m 217 | prometheus-kube-state-metrics-6584885ccf-l7tkm 1/1 Running 0 3m 218 | prometheus-node-exporter-5qvjc 1/1 Running 0 3m 219 | prometheus-node-exporter-bsp48 1/1 Running 0 3m 220 | prometheus-node-exporter-f64cr 1/1 Running 0 3m 221 | prometheus-node-exporter-r7t7c 1/1 Running 0 3m 222 | prometheus-node-exporter-stdjg 1/1 Running 0 3m 223 | prometheus-server-5959898967-s6hjd 2/2 Running 0 3m 224 | ``` 225 | 226 | Run something like this to access the Grafana Dashboard: 227 | 228 | ```bash 229 | $ kubectlforward prometheus-grafana-5bf7b6d949-pldn7 3000 230 | ``` 231 | 232 | Import the kafka-overview_rev1.json and grafana-kafka-dashboard.json provided in the root of this repo as "Kafka Overview" Dashboard. 233 | You'll get a bunch of other very useful dashboard provided throught the Rancher installation. 234 | 235 | ### Clean up 236 | 237 | To clean up your environment, run: 238 | 239 | ```bash 240 | $ k delete all -l app=kafka -n kafka-confluent-5 241 | $ k delete pvc --all 242 | $ k delete ns kafka-confluent-5 243 | ``` 244 | 245 | ### Screenshots 246 | 247 | ![Alt text](./rancher.png?raw=true "Rancher") 248 | ![Alt text](./grafana-kafka-overview.png?raw=true "Grafana Kafka Overview") 249 | ![Alt text](./grafana-dashboards.png?raw=true "Grafana Kafka Dashboards") 250 | ![Alt text](./grafana-kafka-dashboard.png?raw=true "Grafana Kafka Dashboard") 251 | ![Alt text](./openshift.png?raw=true "OpenShift Dashboard") 252 | 253 | 254 | ### Useful links 255 | 256 | https://github.com/edenhill/kafkacat 257 | 258 | https://github.com/Yolean/kubernetes-kafka 259 | 260 | https://docs.confluent.io/current/app-development/kafkacat-usage.html 261 | 262 | https://docs.confluent.io/current/installation/installing_cp/cp-helm-charts/docs/index.html#cp-helm-quickstart 263 | 264 | https://hackernoon.com/a-blockchain-experiment-with-apache-kafka-97ee0ab6aefc 265 | 266 | https://hackernoon.com/simple-chatops-with-kafka-grafana-prometheus-and-slack-764ece59e707 267 | 268 | ### Get in touch 269 | 270 | Join us on Kubernauts Slack Channel: 271 | 272 | https://kubernauts-slack-join.herokuapp.com/ 273 | 274 | 275 | -------------------------------------------------------------------------------- /openshift/streaming-template-confluent-persistenti-gluster.yaml: -------------------------------------------------------------------------------- 1 | id: streaming 2 | kind: Template 3 | apiVersion: v1 4 | name: Streaming Service 5 | metadata: 6 | name: streaming 7 | labels: 8 | category: streaming 9 | annotations: 10 | description: | 11 | This is a test template for our streaming service. In the end it 12 | should provide following services: 13 | * Kafka ✓ 14 | * Kafka Connect 15 | * Kafka Schema Registry 16 | * KSQL 17 | * REST Proxy 18 | tags: "kafka,confluent-platform,streaming" 19 | openshift.io/display-name: "Streaming Service (Confluent Platform Open Source)" 20 | iconClass: "fa pficon-topology" 21 | parameters: 22 | 23 | 24 | 25 | # Zookeeper Parameters 26 | - description: The number of zookeeper nodes to deploy 27 | displayName: Zookeeper node count 28 | name: ZOOKEEPER_NODES 29 | value: "3" 30 | required: true 31 | - description: Persistent volume size for Zookeeper 32 | name: ZOOKEEPER_VOLUME_SIZE 33 | value: 1Gi 34 | required: true 35 | - description: The JVM options for Zookeper 36 | displayName: Zookeeper JVM options 37 | name: ZOOKEEPER_SERVER_JVMFLAGS 38 | value: "-Xmx512m" 39 | - description: The JVM options for Zookeper 40 | displayName: Zookeeper JVM options 41 | name: ZOOKEEPER_SERVER_JVMFLAGS 42 | value: "-Xmx512m" 43 | - description: The name of the OpenShift Service exposed for the zookeeper cluster. 44 | displayName: Zookeeper service name 45 | name: ZOOKEEPER_SERVICE_NAME 46 | value: "zookeeper" 47 | required: true 48 | - description: The name of the OpenShift DNS records service exposed for the zookeeper cluster. 49 | displayName: Zookeeper DNS records service name 50 | name: ZOOKEEPER_DNS_SERVICE_NAME 51 | value: "zoo" 52 | required: true 53 | 54 | 55 | 56 | # Kafka Parameters 57 | - description: The number of kafka nodes to deploy 58 | displayName: Kafka node count 59 | name: KAFKA_NODES 60 | value: "3" 61 | required: true 62 | - description: Persistent volume size for Kafka 63 | name: KAFKA_VOLUME_SIZE 64 | value: 1Gi 65 | required: true 66 | - description: The JVM heap options for Kafka 67 | displayName: Kafka JVM heap options 68 | name: KAFKA_HEAP_OPTS 69 | value: "-Xmx2G" 70 | - description: The name of the Kafka cluster. Will be used to annotate cluster with label 'app' 71 | displayName: App name for Kafka cluster 72 | name: CLUSTER_APP_NAME 73 | value: "kafka" 74 | required: true 75 | - description: The name of the OpenShift Service exposed for the Kafka cluster. 76 | displayName: Kafka service name 77 | name: KAFKA_SERVICE_NAME 78 | value: "kafka" 79 | required: true 80 | - description: The name of the OpenShift DNS records service used for the Kafka brokers. 81 | displayName: Kafka DNS records service name 82 | name: KAFKA_DNS_SERVICE_NAME 83 | value: "broker" 84 | required: true 85 | objects: 86 | 87 | 88 | 89 | # Zookeeper 90 | # Headless service for Zookeeper Identity 91 | - apiVersion: v1 92 | kind: Service 93 | metadata: 94 | name: ${ZOOKEEPER_DNS_SERVICE_NAME} 95 | labels: 96 | app: ${CLUSTER_APP_NAME} 97 | component: zookeeper 98 | spec: 99 | ports: 100 | - port: 2888 101 | name: peer # Peer Port (communication ZK<->ZK) 102 | - port: 3888 103 | name: leader-election # Leader Election Port (ZK<->ZK) 104 | clusterIP: None 105 | selector: 106 | app: ${CLUSTER_APP_NAME} 107 | component: zookeeper 108 | # Service for ZK Clients 109 | - apiVersion: v1 110 | kind: Service 111 | metadata: 112 | name: ${ZOOKEEPER_SERVICE_NAME} 113 | labels: 114 | app: ${CLUSTER_APP_NAME} 115 | component: zookeeper 116 | spec: 117 | ports: 118 | - port: 2181 119 | name: client 120 | selector: 121 | app: ${CLUSTER_APP_NAME} 122 | component: zookeeper 123 | # Stateful Set 124 | - apiVersion: apps/v1beta1 125 | kind: StatefulSet 126 | metadata: 127 | name: ${ZOOKEEPER_DNS_SERVICE_NAME} 128 | labels: 129 | app: ${CLUSTER_APP_NAME} 130 | component: zookeeper 131 | spec: 132 | serviceName: ${ZOOKEEPER_DNS_SERVICE_NAME} 133 | replicas: ${ZOOKEEPER_NODES} 134 | template: 135 | metadata: 136 | labels: 137 | app: ${CLUSTER_APP_NAME} 138 | component: zookeeper 139 | annotations: 140 | prometheus.io/scrape: "true" 141 | prometheus.io/path: "/metrics" 142 | prometheus.io/port: "5555" 143 | spec: 144 | terminationGracePeriodSeconds: 10 145 | containers: 146 | - name: zookeeper 147 | image: 'confluentinc/cp-zookeeper:5.0.0' 148 | env: 149 | - name: KAFKA_HEAP_OPTS 150 | value: '-Xms512M -Xmx512M' 151 | - name: ZOOKEEPER_TICK_TIME 152 | value: '2000' 153 | - name: ZOOKEEPER_SYNC_LIMIT 154 | value: '5' 155 | - name: ZOOKEEPER_INIT_LIMIT 156 | value: '10' 157 | - name: ZOOKEEPER_MAX_CLIENT_CNXNS 158 | value: '60' 159 | - name: ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT 160 | value: '3' 161 | - name: ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL 162 | value: '24' 163 | - name: ZOOKEEPER_CLIENT_PORT 164 | value: '2181' 165 | - name: ZOOKEEPER_SERVER_ID 166 | valueFrom: 167 | fieldRef: 168 | apiVersion: v1 169 | fieldPath: metadata.name 170 | - name: ZOOKEEPER_SERVERS 171 | value: >- 172 | zoo-0.zoo.kafka-confluent-5.svc.cluster.local:2888:3888;zoo-1.zoo.kafka-confluent-5.svc.cluster.local:2888:3888;zoo-2.zoo.kafka-confluent-5.svc.cluster.local:2888:3888 173 | ports: 174 | - containerPort: 2181 175 | name: client 176 | - containerPort: 2888 177 | name: peer 178 | - containerPort: 3888 179 | name: leader-election 180 | volumeMounts: 181 | - name: datadir 182 | mountPath: /var/lib/zookeeper/data 183 | # Set Zookeeper Server ID by fetching the hostname (hostname is of the form `zookeeper-0`, `zookeeper-1`, … 184 | command: 185 | - /bin/bash 186 | - -c 187 | - export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) && /etc/confluent/docker/run 188 | volumes: 189 | - name: datadir 190 | emptyDir: {} 191 | volumeClaimTemplates: 192 | - metadata: 193 | name: datadir 194 | labels: 195 | app: ${CLUSTER_APP_NAME} 196 | component: zookeeper 197 | annotations: 198 | # Required for successfully claiming a persistent volume 199 | volume.beta.kubernetes.io/storage-class: glusterfs 200 | spec: 201 | accessModes: 202 | - ReadWriteOnce 203 | resources: 204 | requests: 205 | storage: ${ZOOKEEPER_VOLUME_SIZE} 206 | # Kafka 207 | # Headless Service 208 | - apiVersion: v1 209 | kind: Service 210 | metadata: 211 | name: ${KAFKA_DNS_SERVICE_NAME} 212 | labels: 213 | app: ${CLUSTER_APP_NAME} 214 | component: kafka-broker 215 | spec: 216 | ports: 217 | - port: 9092 218 | clusterIP: None 219 | selector: 220 | app: ${CLUSTER_APP_NAME} 221 | component: kafka-broker 222 | # Service for bootstrapping 223 | - apiVersion: v1 224 | kind: Service 225 | metadata: 226 | name: ${KAFKA_SERVICE_NAME} 227 | labels: 228 | app: ${CLUSTER_APP_NAME} 229 | component: kafka-broker 230 | spec: 231 | ports: 232 | - port: 9092 233 | selector: 234 | app: ${CLUSTER_APP_NAME} 235 | component: kafka-broker 236 | # StatefulSet 237 | - apiVersion: apps/v1beta1 238 | kind: StatefulSet 239 | metadata: 240 | name: kafka 241 | labels: 242 | app: ${CLUSTER_APP_NAME} 243 | component: kafka-broker 244 | spec: 245 | serviceName: ${KAFKA_DNS_SERVICE_NAME} 246 | replicas: ${KAFKA_NODES} 247 | template: 248 | metadata: 249 | labels: 250 | app: ${CLUSTER_APP_NAME} 251 | component: kafka-broker 252 | annotations: 253 | prometheus.io/scrape: "true" 254 | prometheus.io/path: "/metrics" 255 | prometheus.io/port: "5555" 256 | spec: 257 | terminationGracePeriodSeconds: 10 258 | containers: 259 | - name: broker 260 | image: 'confluentinc/cp-kafka:5.0.0' 261 | env: 262 | - name: POD_IP 263 | valueFrom: 264 | fieldRef: 265 | apiVersion: v1 266 | fieldPath: status.podIP 267 | - name: HOST_IP 268 | valueFrom: 269 | fieldRef: 270 | apiVersion: v1 271 | fieldPath: status.podIP 272 | - name: KAFKA_ADVERTISED_LISTENERS 273 | value: 'EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID}))' 274 | - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP 275 | value: 'PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT' 276 | - name: KAFKA_HEAP_OPTS 277 | value: '-Xmx2G' 278 | - name: KAFKA_ZOOKEEPER_CONNECT 279 | value: zoo 280 | - name: KAFKA_LOG_DIRS 281 | value: /var/lib/kafka/data 282 | - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR 283 | value: '3' 284 | - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR 285 | value: '3' 286 | ports: 287 | - containerPort: 9092 288 | name: kafka 289 | - containerPort: 5555 290 | name: prometheus 291 | volumeMounts: 292 | - name: datadir 293 | mountPath: /var/lib/kafka/data 294 | # subPath is required because the directory provided by 295 | # GlusterFS is not empty: It contains .trash directory for 296 | # trash which we do not need and leads to aborting the 297 | # Kafka startup. 298 | subPath: kafka-data 299 | command: 300 | - /bin/bash 301 | - '-c' 302 | - >- 303 | unset KAFKA_PORT && export KAFKA_BROKER_ID=${HOSTNAME##*-} && \ 304 | 305 | export 306 | KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_IP}:9092,EXTERNAL://$HOSTNAME:$((31090 307 | + ${KAFKA_BROKER_ID})) && \ 308 | 309 | exec /etc/confluent/docker/run 310 | volumes: 311 | - name: datadir 312 | emptyDir: {} 313 | volumeClaimTemplates: 314 | - metadata: 315 | name: datadir 316 | labels: 317 | app: ${CLUSTER_APP_NAME} 318 | component: kafka-broker 319 | annotations: 320 | volume.beta.kubernetes.io/storage-class: glusterfs 321 | spec: 322 | accessModes: 323 | - ReadWriteOnce 324 | resources: 325 | requests: 326 | storage: ${KAFKA_VOLUME_SIZE} 327 | -------------------------------------------------------------------------------- /kafka-overview_rev1.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_MARI", 5 | "label": "", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "graph", 16 | "name": "Graph", 17 | "version": "" 18 | }, 19 | { 20 | "type": "grafana", 21 | "id": "grafana", 22 | "name": "Grafana", 23 | "version": "3.1.1" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "prometheus", 28 | "name": "Prometheus", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "id": null, 33 | "title": "Kafka Overview", 34 | "tags": [], 35 | "style": "dark", 36 | "timezone": "browser", 37 | "editable": true, 38 | "hideControls": false, 39 | "sharedCrosshair": false, 40 | "rows": [ 41 | { 42 | "collapse": false, 43 | "editable": true, 44 | "height": "250px", 45 | "panels": [ 46 | { 47 | "aliasColors": { 48 | "localhost:7071": "#629E51" 49 | }, 50 | "bars": false, 51 | "datasource": "${DS_MARI}", 52 | "editable": true, 53 | "error": false, 54 | "fill": 1, 55 | "grid": { 56 | "threshold1": null, 57 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 58 | "threshold2": null, 59 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 60 | }, 61 | "id": 1, 62 | "isNew": true, 63 | "legend": { 64 | "avg": false, 65 | "current": false, 66 | "max": false, 67 | "min": false, 68 | "show": true, 69 | "total": false, 70 | "values": false 71 | }, 72 | "lines": true, 73 | "linewidth": 2, 74 | "links": [], 75 | "nullPointMode": "connected", 76 | "percentage": false, 77 | "pointradius": 5, 78 | "points": false, 79 | "renderer": "flot", 80 | "seriesOverrides": [], 81 | "span": 4, 82 | "stack": false, 83 | "steppedLine": false, 84 | "targets": [ 85 | { 86 | "expr": "rate(process_cpu_seconds_total{job=\"kafka\"}[1m])", 87 | "intervalFactor": 2, 88 | "legendFormat": "{{instance}}", 89 | "metric": "process_cpu_seconds_total", 90 | "refId": "A", 91 | "step": 4 92 | } 93 | ], 94 | "timeFrom": null, 95 | "timeShift": null, 96 | "title": "CPU Usage", 97 | "tooltip": { 98 | "msResolution": false, 99 | "shared": true, 100 | "sort": 0, 101 | "value_type": "cumulative" 102 | }, 103 | "type": "graph", 104 | "xaxis": { 105 | "show": true 106 | }, 107 | "yaxes": [ 108 | { 109 | "format": "short", 110 | "label": "Cores", 111 | "logBase": 1, 112 | "max": null, 113 | "min": null, 114 | "show": true 115 | }, 116 | { 117 | "format": "short", 118 | "label": null, 119 | "logBase": 1, 120 | "max": null, 121 | "min": null, 122 | "show": true 123 | } 124 | ] 125 | }, 126 | { 127 | "aliasColors": { 128 | "localhost:7071": "#BA43A9" 129 | }, 130 | "bars": false, 131 | "datasource": "${DS_MARI}", 132 | "editable": true, 133 | "error": false, 134 | "fill": 1, 135 | "grid": { 136 | "threshold1": null, 137 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 138 | "threshold2": null, 139 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 140 | }, 141 | "id": 2, 142 | "isNew": true, 143 | "legend": { 144 | "avg": false, 145 | "current": false, 146 | "max": false, 147 | "min": false, 148 | "show": true, 149 | "total": false, 150 | "values": false 151 | }, 152 | "lines": true, 153 | "linewidth": 2, 154 | "links": [], 155 | "nullPointMode": "connected", 156 | "percentage": false, 157 | "pointradius": 5, 158 | "points": false, 159 | "renderer": "flot", 160 | "seriesOverrides": [], 161 | "span": 4, 162 | "stack": false, 163 | "steppedLine": false, 164 | "targets": [ 165 | { 166 | "expr": "sum without(area)(jvm_memory_bytes_used{job=\"kafka\"})", 167 | "intervalFactor": 2, 168 | "legendFormat": "{{instance}}", 169 | "metric": "jvm_memory_bytes_used", 170 | "refId": "A", 171 | "step": 4 172 | } 173 | ], 174 | "timeFrom": null, 175 | "timeShift": null, 176 | "title": "JVM Memory Used", 177 | "tooltip": { 178 | "msResolution": false, 179 | "shared": true, 180 | "sort": 0, 181 | "value_type": "cumulative" 182 | }, 183 | "type": "graph", 184 | "xaxis": { 185 | "show": true 186 | }, 187 | "yaxes": [ 188 | { 189 | "format": "bytes", 190 | "label": "Memory", 191 | "logBase": 1, 192 | "max": null, 193 | "min": null, 194 | "show": true 195 | }, 196 | { 197 | "format": "short", 198 | "label": null, 199 | "logBase": 1, 200 | "max": null, 201 | "min": null, 202 | "show": true 203 | } 204 | ] 205 | }, 206 | { 207 | "aliasColors": { 208 | "localhost:7071": "#890F02" 209 | }, 210 | "bars": false, 211 | "datasource": "${DS_MARI}", 212 | "editable": true, 213 | "error": false, 214 | "fill": 1, 215 | "grid": { 216 | "threshold1": null, 217 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 218 | "threshold2": null, 219 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 220 | }, 221 | "id": 3, 222 | "isNew": true, 223 | "legend": { 224 | "avg": false, 225 | "current": false, 226 | "max": false, 227 | "min": false, 228 | "show": true, 229 | "total": false, 230 | "values": false 231 | }, 232 | "lines": true, 233 | "linewidth": 2, 234 | "links": [], 235 | "nullPointMode": "connected", 236 | "percentage": false, 237 | "pointradius": 5, 238 | "points": false, 239 | "renderer": "flot", 240 | "seriesOverrides": [], 241 | "span": 4, 242 | "stack": false, 243 | "steppedLine": false, 244 | "targets": [ 245 | { 246 | "expr": "sum without(gc)(rate(jvm_gc_collection_seconds_sum{job=\"kafka\"}[5m]))", 247 | "intervalFactor": 2, 248 | "legendFormat": "{{instance}}", 249 | "metric": "jvm_gc_collection_seconds_sum", 250 | "refId": "A", 251 | "step": 4 252 | } 253 | ], 254 | "timeFrom": null, 255 | "timeShift": null, 256 | "title": "Time spent in GC", 257 | "tooltip": { 258 | "msResolution": false, 259 | "shared": true, 260 | "sort": 0, 261 | "value_type": "cumulative" 262 | }, 263 | "type": "graph", 264 | "xaxis": { 265 | "show": true 266 | }, 267 | "yaxes": [ 268 | { 269 | "format": "percentunit", 270 | "label": "% time in GC", 271 | "logBase": 1, 272 | "max": null, 273 | "min": null, 274 | "show": true 275 | }, 276 | { 277 | "format": "short", 278 | "label": null, 279 | "logBase": 1, 280 | "max": null, 281 | "min": null, 282 | "show": true 283 | } 284 | ] 285 | } 286 | ], 287 | "title": "Row" 288 | }, 289 | { 290 | "collapse": false, 291 | "editable": true, 292 | "height": "250px", 293 | "panels": [ 294 | { 295 | "aliasColors": {}, 296 | "bars": false, 297 | "datasource": "${DS_MARI}", 298 | "editable": true, 299 | "error": false, 300 | "fill": 1, 301 | "grid": { 302 | "threshold1": null, 303 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 304 | "threshold2": null, 305 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 306 | }, 307 | "id": 4, 308 | "isNew": true, 309 | "legend": { 310 | "avg": false, 311 | "current": false, 312 | "max": false, 313 | "min": false, 314 | "show": true, 315 | "total": false, 316 | "values": false 317 | }, 318 | "lines": true, 319 | "linewidth": 2, 320 | "links": [], 321 | "nullPointMode": "connected", 322 | "percentage": false, 323 | "pointradius": 5, 324 | "points": false, 325 | "renderer": "flot", 326 | "seriesOverrides": [], 327 | "span": 4, 328 | "stack": false, 329 | "steppedLine": false, 330 | "targets": [ 331 | { 332 | "expr": "sum without(instance)(rate(kafka_server_brokertopicmetrics_messagesin_total{job=\"kafka\",topic!=\"\"}[5m]))", 333 | "intervalFactor": 2, 334 | "legendFormat": "{{topic}}", 335 | "metric": "kafka_server_brokertopicmetrics_messagesin_total", 336 | "refId": "A", 337 | "step": 4 338 | } 339 | ], 340 | "timeFrom": null, 341 | "timeShift": null, 342 | "title": "Messages In Per Topic", 343 | "tooltip": { 344 | "msResolution": false, 345 | "shared": true, 346 | "sort": 0, 347 | "value_type": "cumulative" 348 | }, 349 | "type": "graph", 350 | "xaxis": { 351 | "show": true 352 | }, 353 | "yaxes": [ 354 | { 355 | "format": "short", 356 | "label": "Messages/s", 357 | "logBase": 1, 358 | "max": null, 359 | "min": null, 360 | "show": true 361 | }, 362 | { 363 | "format": "short", 364 | "label": null, 365 | "logBase": 1, 366 | "max": null, 367 | "min": null, 368 | "show": true 369 | } 370 | ] 371 | }, 372 | { 373 | "aliasColors": {}, 374 | "bars": false, 375 | "datasource": "${DS_MARI}", 376 | "editable": true, 377 | "error": false, 378 | "fill": 1, 379 | "grid": { 380 | "threshold1": null, 381 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 382 | "threshold2": null, 383 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 384 | }, 385 | "id": 5, 386 | "isNew": true, 387 | "legend": { 388 | "avg": false, 389 | "current": false, 390 | "max": false, 391 | "min": false, 392 | "show": true, 393 | "total": false, 394 | "values": false 395 | }, 396 | "lines": true, 397 | "linewidth": 2, 398 | "links": [], 399 | "nullPointMode": "connected", 400 | "percentage": false, 401 | "pointradius": 5, 402 | "points": false, 403 | "renderer": "flot", 404 | "seriesOverrides": [], 405 | "span": 4, 406 | "stack": false, 407 | "steppedLine": false, 408 | "targets": [ 409 | { 410 | "expr": "sum without(instance)(rate(kafka_server_brokertopicmetrics_bytesin_total{job=\"kafka\",topic!=\"\"}[5m]))", 411 | "intervalFactor": 2, 412 | "legendFormat": "{{topic}}", 413 | "metric": "kafka_server_brokertopicmetrics_bytesin_total", 414 | "refId": "A", 415 | "step": 4 416 | } 417 | ], 418 | "timeFrom": null, 419 | "timeShift": null, 420 | "title": "Bytes In Per Topic", 421 | "tooltip": { 422 | "msResolution": false, 423 | "shared": true, 424 | "sort": 0, 425 | "value_type": "cumulative" 426 | }, 427 | "type": "graph", 428 | "xaxis": { 429 | "show": true 430 | }, 431 | "yaxes": [ 432 | { 433 | "format": "Bps", 434 | "label": "Bytes/s", 435 | "logBase": 1, 436 | "max": null, 437 | "min": null, 438 | "show": true 439 | }, 440 | { 441 | "format": "short", 442 | "label": null, 443 | "logBase": 1, 444 | "max": null, 445 | "min": null, 446 | "show": true 447 | } 448 | ] 449 | }, 450 | { 451 | "aliasColors": {}, 452 | "bars": false, 453 | "datasource": "${DS_MARI}", 454 | "editable": true, 455 | "error": false, 456 | "fill": 1, 457 | "grid": { 458 | "threshold1": null, 459 | "threshold1Color": "rgba(216, 200, 27, 0.27)", 460 | "threshold2": null, 461 | "threshold2Color": "rgba(234, 112, 112, 0.22)" 462 | }, 463 | "id": 6, 464 | "isNew": true, 465 | "legend": { 466 | "avg": false, 467 | "current": false, 468 | "max": false, 469 | "min": false, 470 | "show": true, 471 | "total": false, 472 | "values": false 473 | }, 474 | "lines": true, 475 | "linewidth": 2, 476 | "links": [], 477 | "nullPointMode": "connected", 478 | "percentage": false, 479 | "pointradius": 5, 480 | "points": false, 481 | "renderer": "flot", 482 | "seriesOverrides": [], 483 | "span": 4, 484 | "stack": false, 485 | "steppedLine": false, 486 | "targets": [ 487 | { 488 | "expr": "sum without(instance)(rate(kafka_server_brokertopicmetrics_bytesout_total{job=\"kafka\",topic!=\"\"}[5m]))", 489 | "intervalFactor": 2, 490 | "legendFormat": "{{topic}}", 491 | "metric": "kafka_server_brokertopicmetrics_bytesin_total", 492 | "refId": "A", 493 | "step": 4 494 | } 495 | ], 496 | "timeFrom": null, 497 | "timeShift": null, 498 | "title": "Bytes Out Per Topic", 499 | "tooltip": { 500 | "msResolution": false, 501 | "shared": true, 502 | "sort": 0, 503 | "value_type": "cumulative" 504 | }, 505 | "type": "graph", 506 | "xaxis": { 507 | "show": true 508 | }, 509 | "yaxes": [ 510 | { 511 | "format": "Bps", 512 | "label": "Bytes/s", 513 | "logBase": 1, 514 | "max": null, 515 | "min": null, 516 | "show": true 517 | }, 518 | { 519 | "format": "short", 520 | "label": null, 521 | "logBase": 1, 522 | "max": null, 523 | "min": null, 524 | "show": true 525 | } 526 | ] 527 | } 528 | ], 529 | "title": "New row" 530 | } 531 | ], 532 | "time": { 533 | "from": "now-30m", 534 | "to": "now" 535 | }, 536 | "timepicker": { 537 | "refresh_intervals": [ 538 | "5s", 539 | "10s", 540 | "30s", 541 | "1m", 542 | "5m", 543 | "15m", 544 | "30m", 545 | "1h", 546 | "2h", 547 | "1d" 548 | ], 549 | "time_options": [ 550 | "5m", 551 | "15m", 552 | "1h", 553 | "6h", 554 | "12h", 555 | "24h", 556 | "2d", 557 | "7d", 558 | "30d" 559 | ] 560 | }, 561 | "templating": { 562 | "list": [] 563 | }, 564 | "annotations": { 565 | "list": [] 566 | }, 567 | "schemaVersion": 12, 568 | "version": 2, 569 | "links": [], 570 | "gnetId": 3580, 571 | "description": "Kafka resource usage and throughput" 572 | } -------------------------------------------------------------------------------- /grafana-kafka-dashboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "$$hashKey": "object:3299", 6 | "builtIn": 1, 7 | "datasource": "prometheus", 8 | "enable": true, 9 | "hide": true, 10 | "iconColor": "rgba(0, 211, 255, 1)", 11 | "limit": 100, 12 | "name": "Annotations & Alerts", 13 | "showIn": 0, 14 | "type": "dashboard" 15 | } 16 | ] 17 | }, 18 | "editable": true, 19 | "gnetId": null, 20 | "graphTooltip": 0, 21 | "id": 16, 22 | "links": [], 23 | "panels": [ 24 | { 25 | "cacheTimeout": null, 26 | "colorBackground": false, 27 | "colorValue": true, 28 | "colors": [ 29 | "rgba(245, 54, 54, 0.9)", 30 | "rgba(237, 129, 40, 0.89)", 31 | "rgba(50, 172, 45, 0.97)" 32 | ], 33 | "datasource": "-- Mixed --", 34 | "decimals": null, 35 | "editable": true, 36 | "error": false, 37 | "format": "none", 38 | "gauge": { 39 | "maxValue": 100, 40 | "minValue": 0, 41 | "show": false, 42 | "thresholdLabels": false, 43 | "thresholdMarkers": true 44 | }, 45 | "gridPos": { 46 | "h": 5, 47 | "w": 12, 48 | "x": 0, 49 | "y": 0 50 | }, 51 | "id": 1, 52 | "interval": null, 53 | "links": [], 54 | "mappingType": 1, 55 | "mappingTypes": [ 56 | { 57 | "name": "value to text", 58 | "value": 1 59 | }, 60 | { 61 | "name": "range to text", 62 | "value": 2 63 | } 64 | ], 65 | "maxDataPoints": 100, 66 | "nullPointMode": "connected", 67 | "nullText": null, 68 | "postfix": " messages", 69 | "postfixFontSize": "50%", 70 | "prefix": "", 71 | "prefixFontSize": "30%", 72 | "rangeMaps": [ 73 | { 74 | "from": "null", 75 | "text": "N/A", 76 | "to": "null" 77 | } 78 | ], 79 | "sparkline": { 80 | "fillColor": "rgba(31, 118, 189, 0.18)", 81 | "full": false, 82 | "lineColor": "rgb(31, 120, 193)", 83 | "show": false 84 | }, 85 | "tableColumn": "", 86 | "targets": [ 87 | { 88 | "datasource": "-- Grafana --", 89 | "expr": "sum(kafka_log_log_value{ name=\"LogEndOffset\" , topic = \"transactions\" }) - sum(kafka_log_log_value{ name=\"LogStartOffset\", topic = \"transactions\" })", 90 | "intervalFactor": 2, 91 | "legendFormat": "", 92 | "metric": "", 93 | "refId": "A", 94 | "step": 20 95 | } 96 | ], 97 | "thresholds": "", 98 | "title": "transactions topic", 99 | "transparent": false, 100 | "type": "singlestat", 101 | "valueFontSize": "200%", 102 | "valueMaps": [ 103 | { 104 | "op": "=", 105 | "text": "N/A", 106 | "value": "null" 107 | } 108 | ], 109 | "valueName": "current" 110 | }, 111 | { 112 | "cacheTimeout": null, 113 | "colorBackground": false, 114 | "colorValue": true, 115 | "colors": [ 116 | "#7eb26d", 117 | "rgba(237, 129, 40, 0.89)", 118 | "#d44a3a" 119 | ], 120 | "datasource": "-- Grafana --", 121 | "format": "h", 122 | "gauge": { 123 | "maxValue": 100, 124 | "minValue": 0, 125 | "show": false, 126 | "thresholdLabels": false, 127 | "thresholdMarkers": true 128 | }, 129 | "gridPos": { 130 | "h": 5, 131 | "w": 12, 132 | "x": 12, 133 | "y": 0 134 | }, 135 | "id": 15, 136 | "interval": null, 137 | "links": [], 138 | "mappingType": 1, 139 | "mappingTypes": [ 140 | { 141 | "name": "value to text", 142 | "value": 1 143 | }, 144 | { 145 | "name": "range to text", 146 | "value": 2 147 | } 148 | ], 149 | "maxDataPoints": 100, 150 | "nullPointMode": "connected", 151 | "nullText": null, 152 | "postfix": "", 153 | "postfixFontSize": "50%", 154 | "prefix": "", 155 | "prefixFontSize": "50%", 156 | "rangeMaps": [ 157 | { 158 | "from": "null", 159 | "text": "N/A", 160 | "to": "null" 161 | } 162 | ], 163 | "sparkline": { 164 | "fillColor": "rgba(31, 118, 189, 0.18)", 165 | "full": false, 166 | "lineColor": "rgb(31, 120, 193)", 167 | "show": false 168 | }, 169 | "tableColumn": "", 170 | "targets": [ 171 | { 172 | "$$hashKey": "object:2973", 173 | "expr": "java_lang_runtime_uptime", 174 | "format": "time_series", 175 | "hide": false, 176 | "intervalFactor": 2, 177 | "refId": "A" 178 | } 179 | ], 180 | "thresholds": "", 181 | "title": "Kafka Broker Uptime", 182 | "type": "singlestat", 183 | "valueFontSize": "80%", 184 | "valueMaps": [ 185 | { 186 | "op": "=", 187 | "text": "N/A", 188 | "value": "null" 189 | } 190 | ], 191 | "valueName": "avg" 192 | }, 193 | { 194 | "aliasColors": {}, 195 | "bars": false, 196 | "dashLength": 10, 197 | "dashes": false, 198 | "datasource": "-- Grafana --", 199 | "editable": true, 200 | "error": false, 201 | "fill": 1, 202 | "grid": {}, 203 | "gridPos": { 204 | "h": 8, 205 | "w": 12, 206 | "x": 0, 207 | "y": 5 208 | }, 209 | "id": 2, 210 | "legend": { 211 | "alignAsTable": false, 212 | "avg": false, 213 | "current": true, 214 | "hideEmpty": false, 215 | "hideZero": false, 216 | "max": false, 217 | "min": false, 218 | "rightSide": false, 219 | "show": true, 220 | "total": false, 221 | "values": true 222 | }, 223 | "lines": true, 224 | "linewidth": 2, 225 | "links": [], 226 | "nullPointMode": "connected", 227 | "percentage": false, 228 | "pointradius": 5, 229 | "points": false, 230 | "renderer": "flot", 231 | "seriesOverrides": [], 232 | "spaceLength": 10, 233 | "stack": false, 234 | "steppedLine": false, 235 | "targets": [ 236 | { 237 | "expr": "kafka_server_brokertopicmetrics_oneminuterate{name=\"BytesInPerSec\"}", 238 | "intervalFactor": 2, 239 | "refId": "A", 240 | "step": 2 241 | }, 242 | { 243 | "expr": "kafka_server_brokertopicmetrics_oneminuterate{name=\"BytesOutPerSec\"}", 244 | "intervalFactor": 2, 245 | "legendFormat": "", 246 | "refId": "B", 247 | "step": 2 248 | } 249 | ], 250 | "thresholds": [], 251 | "timeFrom": null, 252 | "timeShift": null, 253 | "title": "Topic BytesIn to BytesOut Rate", 254 | "tooltip": { 255 | "msResolution": false, 256 | "shared": true, 257 | "sort": 0, 258 | "value_type": "cumulative" 259 | }, 260 | "transparent": false, 261 | "type": "graph", 262 | "xaxis": { 263 | "buckets": null, 264 | "mode": "time", 265 | "name": null, 266 | "show": true, 267 | "values": [] 268 | }, 269 | "yaxes": [ 270 | { 271 | "format": "Bps", 272 | "label": null, 273 | "logBase": 1, 274 | "max": null, 275 | "min": null, 276 | "show": true 277 | }, 278 | { 279 | "format": "short", 280 | "label": null, 281 | "logBase": 1, 282 | "max": null, 283 | "min": null, 284 | "show": true 285 | } 286 | ] 287 | }, 288 | { 289 | "aliasColors": {}, 290 | "bars": false, 291 | "dashLength": 10, 292 | "dashes": false, 293 | "datasource": "-- Grafana --", 294 | "editable": true, 295 | "error": false, 296 | "fill": 1, 297 | "grid": {}, 298 | "gridPos": { 299 | "h": 8, 300 | "w": 12, 301 | "x": 12, 302 | "y": 5 303 | }, 304 | "id": 6, 305 | "legend": { 306 | "avg": false, 307 | "current": false, 308 | "max": false, 309 | "min": false, 310 | "show": true, 311 | "total": false, 312 | "values": false 313 | }, 314 | "lines": true, 315 | "linewidth": 2, 316 | "links": [], 317 | "nullPointMode": "connected", 318 | "percentage": false, 319 | "pointradius": 5, 320 | "points": false, 321 | "renderer": "flot", 322 | "seriesOverrides": [], 323 | "spaceLength": 10, 324 | "stack": false, 325 | "steppedLine": false, 326 | "targets": [ 327 | { 328 | "expr": "kafka_network_processor_value", 329 | "intervalFactor": 2, 330 | "refId": "A", 331 | "step": 2 332 | } 333 | ], 334 | "thresholds": [], 335 | "timeFrom": null, 336 | "timeShift": null, 337 | "title": "Network Processor Idle (%)", 338 | "tooltip": { 339 | "msResolution": false, 340 | "shared": true, 341 | "sort": 0, 342 | "value_type": "cumulative" 343 | }, 344 | "type": "graph", 345 | "xaxis": { 346 | "buckets": null, 347 | "mode": "time", 348 | "name": null, 349 | "show": true, 350 | "values": [] 351 | }, 352 | "yaxes": [ 353 | { 354 | "format": "percentunit", 355 | "label": null, 356 | "logBase": 1, 357 | "max": null, 358 | "min": null, 359 | "show": true 360 | }, 361 | { 362 | "format": "short", 363 | "label": null, 364 | "logBase": 1, 365 | "max": null, 366 | "min": null, 367 | "show": true 368 | } 369 | ] 370 | }, 371 | { 372 | "aliasColors": {}, 373 | "bars": false, 374 | "dashLength": 10, 375 | "dashes": false, 376 | "datasource": "-- Grafana --", 377 | "editable": true, 378 | "error": false, 379 | "fill": 1, 380 | "grid": {}, 381 | "gridPos": { 382 | "h": 7, 383 | "w": 12, 384 | "x": 0, 385 | "y": 13 386 | }, 387 | "id": 4, 388 | "legend": { 389 | "avg": false, 390 | "current": false, 391 | "max": false, 392 | "min": false, 393 | "show": true, 394 | "total": false, 395 | "values": false 396 | }, 397 | "lines": true, 398 | "linewidth": 2, 399 | "links": [], 400 | "nullPointMode": "connected", 401 | "percentage": false, 402 | "pointradius": 5, 403 | "points": false, 404 | "renderer": "flot", 405 | "seriesOverrides": [], 406 | "spaceLength": 10, 407 | "stack": false, 408 | "steppedLine": false, 409 | "targets": [ 410 | { 411 | "expr": "java_lang_memory_heapmemoryusage_used", 412 | "intervalFactor": 2, 413 | "legendFormat": "", 414 | "refId": "A", 415 | "step": 2 416 | } 417 | ], 418 | "thresholds": [], 419 | "timeFrom": null, 420 | "timeShift": null, 421 | "title": "JVM Heap Memory Usage", 422 | "tooltip": { 423 | "msResolution": false, 424 | "shared": true, 425 | "sort": 0, 426 | "value_type": "cumulative" 427 | }, 428 | "type": "graph", 429 | "xaxis": { 430 | "buckets": null, 431 | "mode": "time", 432 | "name": null, 433 | "show": true, 434 | "values": [] 435 | }, 436 | "yaxes": [ 437 | { 438 | "format": "bytes", 439 | "label": null, 440 | "logBase": 1, 441 | "max": null, 442 | "min": null, 443 | "show": true 444 | }, 445 | { 446 | "format": "short", 447 | "label": null, 448 | "logBase": 1, 449 | "max": null, 450 | "min": null, 451 | "show": true 452 | } 453 | ] 454 | }, 455 | { 456 | "aliasColors": {}, 457 | "bars": false, 458 | "dashLength": 10, 459 | "dashes": false, 460 | "datasource": "-- Grafana --", 461 | "editable": true, 462 | "error": false, 463 | "fill": 1, 464 | "grid": {}, 465 | "gridPos": { 466 | "h": 7, 467 | "w": 12, 468 | "x": 12, 469 | "y": 13 470 | }, 471 | "id": 7, 472 | "legend": { 473 | "avg": false, 474 | "current": false, 475 | "max": false, 476 | "min": false, 477 | "show": true, 478 | "total": false, 479 | "values": false 480 | }, 481 | "lines": true, 482 | "linewidth": 2, 483 | "links": [], 484 | "nullPointMode": "connected", 485 | "percentage": false, 486 | "pointradius": 5, 487 | "points": false, 488 | "renderer": "flot", 489 | "seriesOverrides": [], 490 | "spaceLength": 10, 491 | "stack": false, 492 | "steppedLine": false, 493 | "targets": [ 494 | { 495 | "expr": "java_lang_operatingsystem_systemcpuload", 496 | "intervalFactor": 2, 497 | "refId": "A", 498 | "step": 2 499 | } 500 | ], 501 | "thresholds": [], 502 | "timeFrom": null, 503 | "timeShift": null, 504 | "title": "JVM System CPU Load", 505 | "tooltip": { 506 | "msResolution": false, 507 | "shared": true, 508 | "sort": 0, 509 | "value_type": "cumulative" 510 | }, 511 | "type": "graph", 512 | "xaxis": { 513 | "buckets": null, 514 | "mode": "time", 515 | "name": null, 516 | "show": true, 517 | "values": [] 518 | }, 519 | "yaxes": [ 520 | { 521 | "format": "percentunit", 522 | "label": null, 523 | "logBase": 1, 524 | "max": null, 525 | "min": null, 526 | "show": true 527 | }, 528 | { 529 | "format": "short", 530 | "label": null, 531 | "logBase": 1, 532 | "max": null, 533 | "min": null, 534 | "show": true 535 | } 536 | ] 537 | }, 538 | { 539 | "aliasColors": {}, 540 | "bars": false, 541 | "dashLength": 10, 542 | "dashes": false, 543 | "datasource": "-- Grafana --", 544 | "editable": true, 545 | "error": false, 546 | "fill": 1, 547 | "grid": {}, 548 | "gridPos": { 549 | "h": 7, 550 | "w": 12, 551 | "x": 0, 552 | "y": 20 553 | }, 554 | "id": 13, 555 | "legend": { 556 | "alignAsTable": false, 557 | "avg": false, 558 | "current": false, 559 | "max": false, 560 | "min": false, 561 | "show": true, 562 | "total": false, 563 | "values": false 564 | }, 565 | "lines": true, 566 | "linewidth": 2, 567 | "links": [], 568 | "nullPointMode": "connected", 569 | "percentage": false, 570 | "pointradius": 5, 571 | "points": false, 572 | "renderer": "flot", 573 | "seriesOverrides": [], 574 | "spaceLength": 10, 575 | "stack": false, 576 | "steppedLine": false, 577 | "targets": [ 578 | { 579 | "expr": "kafka_server_kafkarequesthandlerpool_oneminuterate", 580 | "intervalFactor": 2, 581 | "legendFormat": "", 582 | "metric": "kafka_server_replicafetchermanager_value", 583 | "refId": "A", 584 | "step": 2 585 | } 586 | ], 587 | "thresholds": [], 588 | "timeFrom": null, 589 | "timeShift": null, 590 | "title": "Request Handler Idle (%)", 591 | "tooltip": { 592 | "msResolution": false, 593 | "shared": true, 594 | "sort": 0, 595 | "value_type": "cumulative" 596 | }, 597 | "type": "graph", 598 | "xaxis": { 599 | "buckets": null, 600 | "mode": "time", 601 | "name": null, 602 | "show": true, 603 | "values": [] 604 | }, 605 | "yaxes": [ 606 | { 607 | "format": "percentunit", 608 | "label": "", 609 | "logBase": 1, 610 | "max": null, 611 | "min": null, 612 | "show": true 613 | }, 614 | { 615 | "format": "short", 616 | "label": "", 617 | "logBase": 1, 618 | "max": null, 619 | "min": null, 620 | "show": true 621 | } 622 | ] 623 | }, 624 | { 625 | "aliasColors": {}, 626 | "bars": false, 627 | "dashLength": 10, 628 | "dashes": false, 629 | "datasource": "-- Grafana --", 630 | "editable": true, 631 | "error": false, 632 | "fill": 1, 633 | "grid": {}, 634 | "gridPos": { 635 | "h": 7, 636 | "w": 12, 637 | "x": 12, 638 | "y": 20 639 | }, 640 | "id": 11, 641 | "legend": { 642 | "avg": false, 643 | "current": false, 644 | "max": false, 645 | "min": false, 646 | "show": false, 647 | "total": false, 648 | "values": false 649 | }, 650 | "lines": true, 651 | "linewidth": 2, 652 | "links": [], 653 | "nullPointMode": "connected", 654 | "percentage": false, 655 | "pointradius": 5, 656 | "points": false, 657 | "renderer": "flot", 658 | "seriesOverrides": [], 659 | "spaceLength": 10, 660 | "stack": false, 661 | "steppedLine": false, 662 | "targets": [ 663 | { 664 | "expr": "kafka_network_requestmetrics_oneminuterate", 665 | "intervalFactor": 2, 666 | "legendFormat": "", 667 | "refId": "A", 668 | "step": 2 669 | } 670 | ], 671 | "thresholds": [], 672 | "timeFrom": null, 673 | "timeShift": null, 674 | "title": "Kafka Network Request Metrics", 675 | "tooltip": { 676 | "msResolution": true, 677 | "shared": true, 678 | "sort": 0, 679 | "value_type": "cumulative" 680 | }, 681 | "transparent": false, 682 | "type": "graph", 683 | "xaxis": { 684 | "buckets": null, 685 | "mode": "time", 686 | "name": null, 687 | "show": true, 688 | "values": [] 689 | }, 690 | "yaxes": [ 691 | { 692 | "format": "short", 693 | "label": null, 694 | "logBase": 1, 695 | "max": null, 696 | "min": null, 697 | "show": true 698 | }, 699 | { 700 | "format": "short", 701 | "label": null, 702 | "logBase": 1, 703 | "max": null, 704 | "min": null, 705 | "show": true 706 | } 707 | ] 708 | }, 709 | { 710 | "cacheTimeout": null, 711 | "colorBackground": false, 712 | "colorValue": true, 713 | "colors": [ 714 | "rgba(245, 54, 54, 0.9)", 715 | "rgba(237, 129, 40, 0.89)", 716 | "rgba(50, 172, 45, 0.97)" 717 | ], 718 | "datasource": "-- Grafana --", 719 | "decimals": null, 720 | "editable": true, 721 | "error": false, 722 | "format": "none", 723 | "gauge": { 724 | "maxValue": 100, 725 | "minValue": 0, 726 | "show": false, 727 | "thresholdLabels": false, 728 | "thresholdMarkers": true 729 | }, 730 | "gridPos": { 731 | "h": 7, 732 | "w": 4, 733 | "x": 0, 734 | "y": 27 735 | }, 736 | "id": 9, 737 | "interval": null, 738 | "links": [], 739 | "mappingType": 1, 740 | "mappingTypes": [ 741 | { 742 | "name": "value to text", 743 | "value": 1 744 | }, 745 | { 746 | "name": "range to text", 747 | "value": 2 748 | } 749 | ], 750 | "maxDataPoints": 100, 751 | "nullPointMode": "connected", 752 | "nullText": null, 753 | "postfix": " partitions", 754 | "postfixFontSize": "50%", 755 | "prefix": "", 756 | "prefixFontSize": "50%", 757 | "rangeMaps": [ 758 | { 759 | "from": "null", 760 | "text": "N/A", 761 | "to": "null" 762 | } 763 | ], 764 | "sparkline": { 765 | "fillColor": "rgba(31, 118, 189, 0.18)", 766 | "full": false, 767 | "lineColor": "rgb(31, 120, 193)", 768 | "show": false 769 | }, 770 | "tableColumn": "", 771 | "targets": [ 772 | { 773 | "expr": "sum(kafka_server_replicamanager_value{name=\"PartitionCount\"})", 774 | "format": "time_series", 775 | "intervalFactor": 2, 776 | "legendFormat": "", 777 | "refId": "A", 778 | "step": 20 779 | } 780 | ], 781 | "thresholds": "", 782 | "title": "Total Partition Count", 783 | "transparent": false, 784 | "type": "singlestat", 785 | "valueFontSize": "200%", 786 | "valueMaps": [ 787 | { 788 | "op": "=", 789 | "text": "N/A", 790 | "value": "null" 791 | } 792 | ], 793 | "valueName": "current" 794 | }, 795 | { 796 | "cacheTimeout": null, 797 | "colorBackground": false, 798 | "colorValue": true, 799 | "colors": [ 800 | "rgba(65, 248, 2, 0.9)", 801 | "rgba(237, 129, 40, 0.89)", 802 | "rgba(50, 172, 45, 0.97)" 803 | ], 804 | "datasource": "-- Grafana --", 805 | "decimals": null, 806 | "editable": true, 807 | "error": false, 808 | "format": "none", 809 | "gauge": { 810 | "maxValue": 100, 811 | "minValue": 0, 812 | "show": false, 813 | "thresholdLabels": false, 814 | "thresholdMarkers": true 815 | }, 816 | "gridPos": { 817 | "h": 7, 818 | "w": 4, 819 | "x": 4, 820 | "y": 27 821 | }, 822 | "id": 10, 823 | "interval": null, 824 | "links": [], 825 | "mappingType": 1, 826 | "mappingTypes": [ 827 | { 828 | "name": "value to text", 829 | "value": 1 830 | }, 831 | { 832 | "name": "range to text", 833 | "value": 2 834 | } 835 | ], 836 | "maxDataPoints": 100, 837 | "nullPointMode": "connected", 838 | "nullText": null, 839 | "postfix": " under replicated", 840 | "postfixFontSize": "50%", 841 | "prefix": "", 842 | "prefixFontSize": "50%", 843 | "rangeMaps": [ 844 | { 845 | "from": "null", 846 | "text": "N/A", 847 | "to": "null" 848 | } 849 | ], 850 | "sparkline": { 851 | "fillColor": "rgba(31, 118, 189, 0.18)", 852 | "full": false, 853 | "lineColor": "rgb(31, 120, 193)", 854 | "show": false 855 | }, 856 | "tableColumn": "", 857 | "targets": [ 858 | { 859 | "expr": "sum(kafka_server_replicamanager_value{name=\"UnderReplicatedPartitions\"})", 860 | "intervalFactor": 2, 861 | "legendFormat": "", 862 | "refId": "A", 863 | "step": 20 864 | } 865 | ], 866 | "thresholds": "", 867 | "title": "Total Under Replicated Partition Count", 868 | "transparent": false, 869 | "type": "singlestat", 870 | "valueFontSize": "200%", 871 | "valueMaps": [ 872 | { 873 | "op": "=", 874 | "text": "N/A", 875 | "value": "null" 876 | } 877 | ], 878 | "valueName": "current" 879 | }, 880 | { 881 | "columns": [ 882 | { 883 | "text": "Current", 884 | "value": "current" 885 | } 886 | ], 887 | "datasource": "-- Grafana --", 888 | "editable": true, 889 | "error": false, 890 | "fontSize": "100%", 891 | "gridPos": { 892 | "h": 7, 893 | "w": 4, 894 | "x": 8, 895 | "y": 27 896 | }, 897 | "id": 14, 898 | "links": [], 899 | "pageSize": null, 900 | "scroll": true, 901 | "showHeader": true, 902 | "sort": { 903 | "col": 1, 904 | "desc": true 905 | }, 906 | "styles": [ 907 | { 908 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 909 | "pattern": "Time", 910 | "type": "date" 911 | }, 912 | { 913 | "colorMode": "cell", 914 | "colors": [ 915 | "rgba(29, 145, 24, 0.97)", 916 | "rgba(255, 115, 0, 0.89)", 917 | "rgba(245, 54, 54, 0.9)" 918 | ], 919 | "decimals": 2, 920 | "pattern": "/.*/", 921 | "thresholds": [], 922 | "type": "number", 923 | "unit": "ms" 924 | } 925 | ], 926 | "targets": [ 927 | { 928 | "expr": "java_lang_runtime_uptime", 929 | "intervalFactor": 2, 930 | "legendFormat": "Broker {{ instance }}", 931 | "refId": "A", 932 | "step": 4 933 | } 934 | ], 935 | "title": "Kafka Broker Uptime", 936 | "transform": "timeseries_aggregations", 937 | "type": "table" 938 | }, 939 | { 940 | "aliasColors": {}, 941 | "bars": false, 942 | "dashLength": 10, 943 | "dashes": false, 944 | "datasource": "-- Grafana --", 945 | "editable": true, 946 | "error": false, 947 | "fill": 1, 948 | "grid": {}, 949 | "gridPos": { 950 | "h": 7, 951 | "w": 12, 952 | "x": 12, 953 | "y": 27 954 | }, 955 | "id": 12, 956 | "legend": { 957 | "avg": false, 958 | "current": false, 959 | "max": false, 960 | "min": false, 961 | "show": true, 962 | "total": false, 963 | "values": false 964 | }, 965 | "lines": true, 966 | "linewidth": 2, 967 | "links": [], 968 | "nullPointMode": "connected", 969 | "percentage": false, 970 | "pointradius": 5, 971 | "points": false, 972 | "renderer": "flot", 973 | "seriesOverrides": [], 974 | "spaceLength": 10, 975 | "stack": false, 976 | "steppedLine": false, 977 | "targets": [ 978 | { 979 | "expr": "kafka_server_replicafetchermanager_value", 980 | "intervalFactor": 2, 981 | "metric": "kafka_server_replicafetchermanager_value", 982 | "refId": "A", 983 | "step": 2 984 | } 985 | ], 986 | "thresholds": [], 987 | "timeFrom": null, 988 | "timeShift": null, 989 | "title": "Max lag in messages btw follower and leader replicas", 990 | "tooltip": { 991 | "msResolution": false, 992 | "shared": true, 993 | "sort": 0, 994 | "value_type": "cumulative" 995 | }, 996 | "type": "graph", 997 | "xaxis": { 998 | "buckets": null, 999 | "mode": "time", 1000 | "name": null, 1001 | "show": true, 1002 | "values": [] 1003 | }, 1004 | "yaxes": [ 1005 | { 1006 | "format": "short", 1007 | "label": null, 1008 | "logBase": 1, 1009 | "max": null, 1010 | "min": null, 1011 | "show": true 1012 | }, 1013 | { 1014 | "format": "short", 1015 | "label": null, 1016 | "logBase": 1, 1017 | "max": null, 1018 | "min": null, 1019 | "show": true 1020 | } 1021 | ] 1022 | }, 1023 | { 1024 | "cacheTimeout": null, 1025 | "colorBackground": false, 1026 | "colorValue": true, 1027 | "colors": [ 1028 | "rgba(245, 54, 54, 0.9)", 1029 | "rgba(237, 129, 40, 0.89)", 1030 | "rgba(50, 172, 45, 0.97)" 1031 | ], 1032 | "datasource": "-- Grafana --", 1033 | "decimals": null, 1034 | "editable": true, 1035 | "error": false, 1036 | "format": "ms", 1037 | "gauge": { 1038 | "maxValue": 100, 1039 | "minValue": 0, 1040 | "show": false, 1041 | "thresholdLabels": false, 1042 | "thresholdMarkers": true 1043 | }, 1044 | "gridPos": { 1045 | "h": 7, 1046 | "w": 20, 1047 | "x": 0, 1048 | "y": 34 1049 | }, 1050 | "id": 5, 1051 | "interval": null, 1052 | "links": [], 1053 | "mappingType": 1, 1054 | "mappingTypes": [ 1055 | { 1056 | "name": "value to text", 1057 | "value": 1 1058 | }, 1059 | { 1060 | "name": "range to text", 1061 | "value": 2 1062 | } 1063 | ], 1064 | "maxDataPoints": 100, 1065 | "nullPointMode": "connected", 1066 | "nullText": null, 1067 | "postfix": "", 1068 | "postfixFontSize": "50%", 1069 | "prefix": "", 1070 | "prefixFontSize": "50%", 1071 | "rangeMaps": [ 1072 | { 1073 | "from": "null", 1074 | "text": "N/A", 1075 | "to": "null" 1076 | } 1077 | ], 1078 | "sparkline": { 1079 | "fillColor": "rgba(31, 118, 189, 0.18)", 1080 | "full": false, 1081 | "lineColor": "rgb(31, 120, 193)", 1082 | "show": false 1083 | }, 1084 | "tableColumn": "", 1085 | "targets": [ 1086 | { 1087 | "expr": "java_lang_runtime_uptime", 1088 | "format": "time_series", 1089 | "intervalFactor": 2, 1090 | "legendFormat": "", 1091 | "refId": "A", 1092 | "step": 20 1093 | } 1094 | ], 1095 | "thresholds": "", 1096 | "title": "Kafka Broker Uptime", 1097 | "transparent": false, 1098 | "type": "singlestat", 1099 | "valueFontSize": "80%", 1100 | "valueMaps": [ 1101 | { 1102 | "op": "=", 1103 | "text": "N/A", 1104 | "value": "null" 1105 | } 1106 | ], 1107 | "valueName": "current" 1108 | } 1109 | ], 1110 | "refresh": false, 1111 | "schemaVersion": 16, 1112 | "style": "dark", 1113 | "tags": [], 1114 | "templating": { 1115 | "list": [] 1116 | }, 1117 | "time": { 1118 | "from": "now-24h", 1119 | "to": "now" 1120 | }, 1121 | "timepicker": { 1122 | "refresh_intervals": [ 1123 | "5s", 1124 | "10s", 1125 | "30s", 1126 | "1m", 1127 | "5m", 1128 | "15m", 1129 | "30m", 1130 | "1h", 1131 | "2h", 1132 | "1d" 1133 | ], 1134 | "time_options": [ 1135 | "5m", 1136 | "15m", 1137 | "1h", 1138 | "6h", 1139 | "12h", 1140 | "24h", 1141 | "2d", 1142 | "7d", 1143 | "30d" 1144 | ] 1145 | }, 1146 | "timezone": "browser", 1147 | "title": "Kafka", 1148 | "uid": "JtWBzWAiz", 1149 | "version": 7 1150 | } 1151 | -------------------------------------------------------------------------------- /grafana-kafka-dashboard-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "editable": true, 16 | "gnetId": null, 17 | "graphTooltip": 0, 18 | "hideControls": false, 19 | "id": 12, 20 | "links": [], 21 | "refresh": false, 22 | "rows": [ 23 | { 24 | "collapse": false, 25 | "height": 162, 26 | "panels": [ 27 | { 28 | "cacheTimeout": null, 29 | "colorBackground": false, 30 | "colorValue": true, 31 | "colors": [ 32 | "rgba(245, 54, 54, 0.9)", 33 | "rgba(237, 129, 40, 0.89)", 34 | "rgba(50, 172, 45, 0.97)" 35 | ], 36 | "datasource": "Prometheus", 37 | "decimals": null, 38 | "editable": true, 39 | "error": false, 40 | "format": "none", 41 | "gauge": { 42 | "maxValue": 100, 43 | "minValue": 0, 44 | "show": false, 45 | "thresholdLabels": false, 46 | "thresholdMarkers": true 47 | }, 48 | "id": 1, 49 | "interval": null, 50 | "links": [], 51 | "mappingType": 1, 52 | "mappingTypes": [ 53 | { 54 | "name": "value to text", 55 | "value": 1 56 | }, 57 | { 58 | "name": "range to text", 59 | "value": 2 60 | } 61 | ], 62 | "maxDataPoints": 100, 63 | "nullPointMode": "connected", 64 | "nullText": null, 65 | "postfix": " messages", 66 | "postfixFontSize": "50%", 67 | "prefix": "", 68 | "prefixFontSize": "30%", 69 | "rangeMaps": [ 70 | { 71 | "from": "null", 72 | "text": "N/A", 73 | "to": "null" 74 | } 75 | ], 76 | "span": 6, 77 | "sparkline": { 78 | "fillColor": "rgba(31, 118, 189, 0.18)", 79 | "full": false, 80 | "lineColor": "rgb(31, 120, 193)", 81 | "show": false 82 | }, 83 | "tableColumn": "", 84 | "targets": [ 85 | { 86 | "expr": "sum(kafka_log_log_value{ name=\"LogEndOffset\" , topic = \"transactions\" }) - sum(kafka_log_log_value{ name=\"LogStartOffset\", topic = \"transactions\" })", 87 | "intervalFactor": 2, 88 | "legendFormat": "", 89 | "metric": "", 90 | "refId": "A", 91 | "step": 20 92 | } 93 | ], 94 | "thresholds": "", 95 | "title": "transactions topic", 96 | "transparent": false, 97 | "type": "singlestat", 98 | "valueFontSize": "200%", 99 | "valueMaps": [ 100 | { 101 | "op": "=", 102 | "text": "N/A", 103 | "value": "null" 104 | } 105 | ], 106 | "valueName": "current" 107 | }, 108 | { 109 | "cacheTimeout": null, 110 | "colorBackground": false, 111 | "colorValue": true, 112 | "colors": [ 113 | "#7eb26d", 114 | "rgba(237, 129, 40, 0.89)", 115 | "#d44a3a" 116 | ], 117 | "datasource": "Prometheus", 118 | "format": "ms", 119 | "gauge": { 120 | "maxValue": 100, 121 | "minValue": 0, 122 | "show": false, 123 | "thresholdLabels": false, 124 | "thresholdMarkers": true 125 | }, 126 | "id": 15, 127 | "interval": null, 128 | "links": [], 129 | "mappingType": 1, 130 | "mappingTypes": [ 131 | { 132 | "name": "value to text", 133 | "value": 1 134 | }, 135 | { 136 | "name": "range to text", 137 | "value": 2 138 | } 139 | ], 140 | "maxDataPoints": 100, 141 | "nullPointMode": "connected", 142 | "nullText": null, 143 | "postfix": "", 144 | "postfixFontSize": "50%", 145 | "prefix": "", 146 | "prefixFontSize": "50%", 147 | "rangeMaps": [ 148 | { 149 | "from": "null", 150 | "text": "N/A", 151 | "to": "null" 152 | } 153 | ], 154 | "span": 6, 155 | "sparkline": { 156 | "fillColor": "rgba(31, 118, 189, 0.18)", 157 | "full": false, 158 | "lineColor": "rgb(31, 120, 193)", 159 | "show": false 160 | }, 161 | "tableColumn": "", 162 | "targets": [ 163 | { 164 | "expr": "java_lang_runtime_uptime", 165 | "format": "time_series", 166 | "intervalFactor": 2, 167 | "refId": "A" 168 | } 169 | ], 170 | "thresholds": "", 171 | "title": "Kafka Broker Uptime", 172 | "type": "singlestat", 173 | "valueFontSize": "80%", 174 | "valueMaps": [ 175 | { 176 | "op": "=", 177 | "text": "N/A", 178 | "value": "null" 179 | } 180 | ], 181 | "valueName": "avg" 182 | } 183 | ], 184 | "repeat": null, 185 | "repeatIteration": null, 186 | "repeatRowId": null, 187 | "showTitle": false, 188 | "title": "Row", 189 | "titleSize": "h6" 190 | }, 191 | { 192 | "collapse": false, 193 | "height": "300px", 194 | "panels": [ 195 | { 196 | "aliasColors": {}, 197 | "bars": false, 198 | "dashLength": 10, 199 | "dashes": false, 200 | "datasource": "Prometheus", 201 | "editable": true, 202 | "error": false, 203 | "fill": 1, 204 | "grid": {}, 205 | "id": 2, 206 | "legend": { 207 | "alignAsTable": false, 208 | "avg": false, 209 | "current": true, 210 | "hideEmpty": false, 211 | "hideZero": false, 212 | "max": false, 213 | "min": false, 214 | "rightSide": false, 215 | "show": true, 216 | "total": false, 217 | "values": true 218 | }, 219 | "lines": true, 220 | "linewidth": 2, 221 | "links": [], 222 | "nullPointMode": "connected", 223 | "percentage": false, 224 | "pointradius": 5, 225 | "points": false, 226 | "renderer": "flot", 227 | "seriesOverrides": [], 228 | "spaceLength": 10, 229 | "span": 6, 230 | "stack": false, 231 | "steppedLine": false, 232 | "targets": [ 233 | { 234 | "expr": "kafka_server_brokertopicmetrics_oneminuterate{name=\"BytesInPerSec\"}", 235 | "intervalFactor": 2, 236 | "refId": "A", 237 | "step": 2 238 | }, 239 | { 240 | "expr": "kafka_server_brokertopicmetrics_oneminuterate{name=\"BytesOutPerSec\"}", 241 | "intervalFactor": 2, 242 | "legendFormat": "", 243 | "refId": "B", 244 | "step": 2 245 | } 246 | ], 247 | "thresholds": [], 248 | "timeFrom": null, 249 | "timeShift": null, 250 | "title": "Topic BytesIn to BytesOut Rate", 251 | "tooltip": { 252 | "msResolution": false, 253 | "shared": true, 254 | "sort": 0, 255 | "value_type": "cumulative" 256 | }, 257 | "transparent": false, 258 | "type": "graph", 259 | "xaxis": { 260 | "buckets": null, 261 | "mode": "time", 262 | "name": null, 263 | "show": true, 264 | "values": [] 265 | }, 266 | "yaxes": [ 267 | { 268 | "format": "Bps", 269 | "label": null, 270 | "logBase": 1, 271 | "max": null, 272 | "min": null, 273 | "show": true 274 | }, 275 | { 276 | "format": "short", 277 | "label": null, 278 | "logBase": 1, 279 | "max": null, 280 | "min": null, 281 | "show": true 282 | } 283 | ] 284 | }, 285 | { 286 | "aliasColors": {}, 287 | "bars": false, 288 | "dashLength": 10, 289 | "dashes": false, 290 | "datasource": "Prometheus", 291 | "editable": true, 292 | "error": false, 293 | "fill": 1, 294 | "grid": {}, 295 | "id": 6, 296 | "legend": { 297 | "avg": false, 298 | "current": false, 299 | "max": false, 300 | "min": false, 301 | "show": true, 302 | "total": false, 303 | "values": false 304 | }, 305 | "lines": true, 306 | "linewidth": 2, 307 | "links": [], 308 | "nullPointMode": "connected", 309 | "percentage": false, 310 | "pointradius": 5, 311 | "points": false, 312 | "renderer": "flot", 313 | "seriesOverrides": [], 314 | "spaceLength": 10, 315 | "span": 6, 316 | "stack": false, 317 | "steppedLine": false, 318 | "targets": [ 319 | { 320 | "expr": "kafka_network_processor_value", 321 | "intervalFactor": 2, 322 | "refId": "A", 323 | "step": 2 324 | } 325 | ], 326 | "thresholds": [], 327 | "timeFrom": null, 328 | "timeShift": null, 329 | "title": "Network Processor Idle (%)", 330 | "tooltip": { 331 | "msResolution": false, 332 | "shared": true, 333 | "sort": 0, 334 | "value_type": "cumulative" 335 | }, 336 | "type": "graph", 337 | "xaxis": { 338 | "buckets": null, 339 | "mode": "time", 340 | "name": null, 341 | "show": true, 342 | "values": [] 343 | }, 344 | "yaxes": [ 345 | { 346 | "format": "percentunit", 347 | "label": null, 348 | "logBase": 1, 349 | "max": null, 350 | "min": null, 351 | "show": true 352 | }, 353 | { 354 | "format": "short", 355 | "label": null, 356 | "logBase": 1, 357 | "max": null, 358 | "min": null, 359 | "show": true 360 | } 361 | ] 362 | } 363 | ], 364 | "repeat": null, 365 | "repeatIteration": null, 366 | "repeatRowId": null, 367 | "showTitle": false, 368 | "title": "New row", 369 | "titleSize": "h6" 370 | }, 371 | { 372 | "collapse": false, 373 | "height": "250px", 374 | "panels": [ 375 | { 376 | "aliasColors": {}, 377 | "bars": false, 378 | "dashLength": 10, 379 | "dashes": false, 380 | "datasource": "Prometheus", 381 | "editable": true, 382 | "error": false, 383 | "fill": 1, 384 | "grid": {}, 385 | "id": 4, 386 | "legend": { 387 | "avg": false, 388 | "current": false, 389 | "max": false, 390 | "min": false, 391 | "show": true, 392 | "total": false, 393 | "values": false 394 | }, 395 | "lines": true, 396 | "linewidth": 2, 397 | "links": [], 398 | "nullPointMode": "connected", 399 | "percentage": false, 400 | "pointradius": 5, 401 | "points": false, 402 | "renderer": "flot", 403 | "seriesOverrides": [], 404 | "spaceLength": 10, 405 | "span": 6, 406 | "stack": false, 407 | "steppedLine": false, 408 | "targets": [ 409 | { 410 | "expr": "java_lang_memory_heapmemoryusage_used", 411 | "intervalFactor": 2, 412 | "legendFormat": "", 413 | "refId": "A", 414 | "step": 2 415 | } 416 | ], 417 | "thresholds": [], 418 | "timeFrom": null, 419 | "timeShift": null, 420 | "title": "JVM Heap Memory Usage", 421 | "tooltip": { 422 | "msResolution": false, 423 | "shared": true, 424 | "sort": 0, 425 | "value_type": "cumulative" 426 | }, 427 | "type": "graph", 428 | "xaxis": { 429 | "buckets": null, 430 | "mode": "time", 431 | "name": null, 432 | "show": true, 433 | "values": [] 434 | }, 435 | "yaxes": [ 436 | { 437 | "format": "bytes", 438 | "label": null, 439 | "logBase": 1, 440 | "max": null, 441 | "min": null, 442 | "show": true 443 | }, 444 | { 445 | "format": "short", 446 | "label": null, 447 | "logBase": 1, 448 | "max": null, 449 | "min": null, 450 | "show": true 451 | } 452 | ] 453 | }, 454 | { 455 | "aliasColors": {}, 456 | "bars": false, 457 | "dashLength": 10, 458 | "dashes": false, 459 | "datasource": "Prometheus", 460 | "editable": true, 461 | "error": false, 462 | "fill": 1, 463 | "grid": {}, 464 | "id": 7, 465 | "legend": { 466 | "avg": false, 467 | "current": false, 468 | "max": false, 469 | "min": false, 470 | "show": true, 471 | "total": false, 472 | "values": false 473 | }, 474 | "lines": true, 475 | "linewidth": 2, 476 | "links": [], 477 | "nullPointMode": "connected", 478 | "percentage": false, 479 | "pointradius": 5, 480 | "points": false, 481 | "renderer": "flot", 482 | "seriesOverrides": [], 483 | "spaceLength": 10, 484 | "span": 6, 485 | "stack": false, 486 | "steppedLine": false, 487 | "targets": [ 488 | { 489 | "expr": "java_lang_operatingsystem_systemcpuload", 490 | "intervalFactor": 2, 491 | "refId": "A", 492 | "step": 2 493 | } 494 | ], 495 | "thresholds": [], 496 | "timeFrom": null, 497 | "timeShift": null, 498 | "title": "JVM System CPU Load", 499 | "tooltip": { 500 | "msResolution": false, 501 | "shared": true, 502 | "sort": 0, 503 | "value_type": "cumulative" 504 | }, 505 | "type": "graph", 506 | "xaxis": { 507 | "buckets": null, 508 | "mode": "time", 509 | "name": null, 510 | "show": true, 511 | "values": [] 512 | }, 513 | "yaxes": [ 514 | { 515 | "format": "percentunit", 516 | "label": null, 517 | "logBase": 1, 518 | "max": null, 519 | "min": null, 520 | "show": true 521 | }, 522 | { 523 | "format": "short", 524 | "label": null, 525 | "logBase": 1, 526 | "max": null, 527 | "min": null, 528 | "show": true 529 | } 530 | ] 531 | } 532 | ], 533 | "repeat": null, 534 | "repeatIteration": null, 535 | "repeatRowId": null, 536 | "showTitle": false, 537 | "title": "New row", 538 | "titleSize": "h6" 539 | }, 540 | { 541 | "collapse": false, 542 | "height": "250px", 543 | "panels": [ 544 | { 545 | "cacheTimeout": null, 546 | "colorBackground": false, 547 | "colorValue": true, 548 | "colors": [ 549 | "rgba(245, 54, 54, 0.9)", 550 | "rgba(237, 129, 40, 0.89)", 551 | "rgba(50, 172, 45, 0.97)" 552 | ], 553 | "datasource": "Prometheus", 554 | "decimals": null, 555 | "editable": true, 556 | "error": false, 557 | "format": "none", 558 | "gauge": { 559 | "maxValue": 100, 560 | "minValue": 0, 561 | "show": false, 562 | "thresholdLabels": false, 563 | "thresholdMarkers": true 564 | }, 565 | "id": 9, 566 | "interval": null, 567 | "links": [], 568 | "mappingType": 1, 569 | "mappingTypes": [ 570 | { 571 | "name": "value to text", 572 | "value": 1 573 | }, 574 | { 575 | "name": "range to text", 576 | "value": 2 577 | } 578 | ], 579 | "maxDataPoints": 100, 580 | "nullPointMode": "connected", 581 | "nullText": null, 582 | "postfix": " partitions", 583 | "postfixFontSize": "50%", 584 | "prefix": "", 585 | "prefixFontSize": "50%", 586 | "rangeMaps": [ 587 | { 588 | "from": "null", 589 | "text": "N/A", 590 | "to": "null" 591 | } 592 | ], 593 | "span": 2, 594 | "sparkline": { 595 | "fillColor": "rgba(31, 118, 189, 0.18)", 596 | "full": false, 597 | "lineColor": "rgb(31, 120, 193)", 598 | "show": false 599 | }, 600 | "tableColumn": "", 601 | "targets": [ 602 | { 603 | "expr": "sum(kafka_server_replicamanager_value{name=\"PartitionCount\"})", 604 | "intervalFactor": 2, 605 | "legendFormat": "", 606 | "refId": "A", 607 | "step": 20 608 | } 609 | ], 610 | "thresholds": "", 611 | "title": "Total Partition Count", 612 | "transparent": false, 613 | "type": "singlestat", 614 | "valueFontSize": "200%", 615 | "valueMaps": [ 616 | { 617 | "op": "=", 618 | "text": "N/A", 619 | "value": "null" 620 | } 621 | ], 622 | "valueName": "current" 623 | }, 624 | { 625 | "cacheTimeout": null, 626 | "colorBackground": false, 627 | "colorValue": true, 628 | "colors": [ 629 | "rgba(65, 248, 2, 0.9)", 630 | "rgba(237, 129, 40, 0.89)", 631 | "rgba(50, 172, 45, 0.97)" 632 | ], 633 | "datasource": "Prometheus", 634 | "decimals": null, 635 | "editable": true, 636 | "error": false, 637 | "format": "none", 638 | "gauge": { 639 | "maxValue": 100, 640 | "minValue": 0, 641 | "show": false, 642 | "thresholdLabels": false, 643 | "thresholdMarkers": true 644 | }, 645 | "id": 10, 646 | "interval": null, 647 | "links": [], 648 | "mappingType": 1, 649 | "mappingTypes": [ 650 | { 651 | "name": "value to text", 652 | "value": 1 653 | }, 654 | { 655 | "name": "range to text", 656 | "value": 2 657 | } 658 | ], 659 | "maxDataPoints": 100, 660 | "nullPointMode": "connected", 661 | "nullText": null, 662 | "postfix": " under replicated", 663 | "postfixFontSize": "50%", 664 | "prefix": "", 665 | "prefixFontSize": "50%", 666 | "rangeMaps": [ 667 | { 668 | "from": "null", 669 | "text": "N/A", 670 | "to": "null" 671 | } 672 | ], 673 | "span": 2, 674 | "sparkline": { 675 | "fillColor": "rgba(31, 118, 189, 0.18)", 676 | "full": false, 677 | "lineColor": "rgb(31, 120, 193)", 678 | "show": false 679 | }, 680 | "tableColumn": "", 681 | "targets": [ 682 | { 683 | "expr": "sum(kafka_server_replicamanager_value{name=\"UnderReplicatedPartitions\"})", 684 | "intervalFactor": 2, 685 | "legendFormat": "", 686 | "refId": "A", 687 | "step": 20 688 | } 689 | ], 690 | "thresholds": "", 691 | "title": "Total Under Replicated Partition Count", 692 | "transparent": false, 693 | "type": "singlestat", 694 | "valueFontSize": "200%", 695 | "valueMaps": [ 696 | { 697 | "op": "=", 698 | "text": "N/A", 699 | "value": "null" 700 | } 701 | ], 702 | "valueName": "current" 703 | }, 704 | { 705 | "columns": [ 706 | { 707 | "text": "Current", 708 | "value": "current" 709 | } 710 | ], 711 | "datasource": "Prometheus", 712 | "editable": true, 713 | "error": false, 714 | "fontSize": "100%", 715 | "id": 14, 716 | "links": [], 717 | "pageSize": null, 718 | "scroll": true, 719 | "showHeader": true, 720 | "sort": { 721 | "col": 0, 722 | "desc": true 723 | }, 724 | "span": 2, 725 | "styles": [ 726 | { 727 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 728 | "pattern": "Time", 729 | "type": "date" 730 | }, 731 | { 732 | "colorMode": "cell", 733 | "colors": [ 734 | "rgba(29, 145, 24, 0.97)", 735 | "rgba(255, 115, 0, 0.89)", 736 | "rgba(245, 54, 54, 0.9)" 737 | ], 738 | "decimals": 2, 739 | "pattern": "/.*/", 740 | "thresholds": [], 741 | "type": "number", 742 | "unit": "ms" 743 | } 744 | ], 745 | "targets": [ 746 | { 747 | "expr": "java_lang_runtime_uptime", 748 | "intervalFactor": 2, 749 | "legendFormat": "Broker {{ instance }}", 750 | "refId": "A", 751 | "step": 4 752 | } 753 | ], 754 | "title": "Kafka Broker Uptime", 755 | "transform": "timeseries_aggregations", 756 | "type": "table" 757 | }, 758 | { 759 | "aliasColors": {}, 760 | "bars": false, 761 | "dashLength": 10, 762 | "dashes": false, 763 | "datasource": "Prometheus", 764 | "editable": true, 765 | "error": false, 766 | "fill": 1, 767 | "grid": {}, 768 | "id": 11, 769 | "legend": { 770 | "avg": false, 771 | "current": false, 772 | "max": false, 773 | "min": false, 774 | "show": false, 775 | "total": false, 776 | "values": false 777 | }, 778 | "lines": true, 779 | "linewidth": 2, 780 | "links": [], 781 | "nullPointMode": "connected", 782 | "percentage": false, 783 | "pointradius": 5, 784 | "points": false, 785 | "renderer": "flot", 786 | "seriesOverrides": [], 787 | "spaceLength": 10, 788 | "span": 6, 789 | "stack": false, 790 | "steppedLine": false, 791 | "targets": [ 792 | { 793 | "expr": "kafka_network_requestmetrics_oneminuterate", 794 | "intervalFactor": 2, 795 | "legendFormat": "", 796 | "refId": "A", 797 | "step": 2 798 | } 799 | ], 800 | "thresholds": [], 801 | "timeFrom": null, 802 | "timeShift": null, 803 | "title": "Kafka Network Request Metrics", 804 | "tooltip": { 805 | "msResolution": true, 806 | "shared": true, 807 | "sort": 0, 808 | "value_type": "cumulative" 809 | }, 810 | "transparent": false, 811 | "type": "graph", 812 | "xaxis": { 813 | "buckets": null, 814 | "mode": "time", 815 | "name": null, 816 | "show": true, 817 | "values": [] 818 | }, 819 | "yaxes": [ 820 | { 821 | "format": "short", 822 | "label": null, 823 | "logBase": 1, 824 | "max": null, 825 | "min": null, 826 | "show": true 827 | }, 828 | { 829 | "format": "short", 830 | "label": null, 831 | "logBase": 1, 832 | "max": null, 833 | "min": null, 834 | "show": true 835 | } 836 | ] 837 | } 838 | ], 839 | "repeat": null, 840 | "repeatIteration": null, 841 | "repeatRowId": null, 842 | "showTitle": false, 843 | "title": "New row", 844 | "titleSize": "h6" 845 | }, 846 | { 847 | "collapse": false, 848 | "height": "250px", 849 | "panels": [ 850 | { 851 | "aliasColors": {}, 852 | "bars": false, 853 | "dashLength": 10, 854 | "dashes": false, 855 | "datasource": "Prometheus", 856 | "editable": true, 857 | "error": false, 858 | "fill": 1, 859 | "grid": {}, 860 | "id": 12, 861 | "legend": { 862 | "avg": false, 863 | "current": false, 864 | "max": false, 865 | "min": false, 866 | "show": true, 867 | "total": false, 868 | "values": false 869 | }, 870 | "lines": true, 871 | "linewidth": 2, 872 | "links": [], 873 | "nullPointMode": "connected", 874 | "percentage": false, 875 | "pointradius": 5, 876 | "points": false, 877 | "renderer": "flot", 878 | "seriesOverrides": [], 879 | "spaceLength": 10, 880 | "span": 6, 881 | "stack": false, 882 | "steppedLine": false, 883 | "targets": [ 884 | { 885 | "expr": "kafka_server_replicafetchermanager_value", 886 | "intervalFactor": 2, 887 | "metric": "kafka_server_replicafetchermanager_value", 888 | "refId": "A", 889 | "step": 2 890 | } 891 | ], 892 | "thresholds": [], 893 | "timeFrom": null, 894 | "timeShift": null, 895 | "title": "Max lag in messages btw follower and leader replicas", 896 | "tooltip": { 897 | "msResolution": false, 898 | "shared": true, 899 | "sort": 0, 900 | "value_type": "cumulative" 901 | }, 902 | "type": "graph", 903 | "xaxis": { 904 | "buckets": null, 905 | "mode": "time", 906 | "name": null, 907 | "show": true, 908 | "values": [] 909 | }, 910 | "yaxes": [ 911 | { 912 | "format": "short", 913 | "label": null, 914 | "logBase": 1, 915 | "max": null, 916 | "min": null, 917 | "show": true 918 | }, 919 | { 920 | "format": "short", 921 | "label": null, 922 | "logBase": 1, 923 | "max": null, 924 | "min": null, 925 | "show": true 926 | } 927 | ] 928 | }, 929 | { 930 | "aliasColors": {}, 931 | "bars": false, 932 | "dashLength": 10, 933 | "dashes": false, 934 | "datasource": "Prometheus", 935 | "editable": true, 936 | "error": false, 937 | "fill": 1, 938 | "grid": {}, 939 | "id": 13, 940 | "legend": { 941 | "alignAsTable": false, 942 | "avg": false, 943 | "current": false, 944 | "max": false, 945 | "min": false, 946 | "show": true, 947 | "total": false, 948 | "values": false 949 | }, 950 | "lines": true, 951 | "linewidth": 2, 952 | "links": [], 953 | "nullPointMode": "connected", 954 | "percentage": false, 955 | "pointradius": 5, 956 | "points": false, 957 | "renderer": "flot", 958 | "seriesOverrides": [], 959 | "spaceLength": 10, 960 | "span": 6, 961 | "stack": false, 962 | "steppedLine": false, 963 | "targets": [ 964 | { 965 | "expr": "kafka_server_kafkarequesthandlerpool_oneminuterate", 966 | "intervalFactor": 2, 967 | "legendFormat": "", 968 | "metric": "kafka_server_replicafetchermanager_value", 969 | "refId": "A", 970 | "step": 2 971 | } 972 | ], 973 | "thresholds": [], 974 | "timeFrom": null, 975 | "timeShift": null, 976 | "title": "Request Handler Idle (%)", 977 | "tooltip": { 978 | "msResolution": false, 979 | "shared": true, 980 | "sort": 0, 981 | "value_type": "cumulative" 982 | }, 983 | "type": "graph", 984 | "xaxis": { 985 | "buckets": null, 986 | "mode": "time", 987 | "name": null, 988 | "show": true, 989 | "values": [] 990 | }, 991 | "yaxes": [ 992 | { 993 | "format": "percentunit", 994 | "label": "", 995 | "logBase": 1, 996 | "max": null, 997 | "min": null, 998 | "show": true 999 | }, 1000 | { 1001 | "format": "short", 1002 | "label": "", 1003 | "logBase": 1, 1004 | "max": null, 1005 | "min": null, 1006 | "show": true 1007 | } 1008 | ] 1009 | } 1010 | ], 1011 | "repeat": null, 1012 | "repeatIteration": null, 1013 | "repeatRowId": null, 1014 | "showTitle": false, 1015 | "title": "New row", 1016 | "titleSize": "h6" 1017 | }, 1018 | { 1019 | "collapse": false, 1020 | "height": "250px", 1021 | "panels": [ 1022 | { 1023 | "cacheTimeout": null, 1024 | "colorBackground": false, 1025 | "colorValue": true, 1026 | "colors": [ 1027 | "rgba(245, 54, 54, 0.9)", 1028 | "rgba(237, 129, 40, 0.89)", 1029 | "rgba(50, 172, 45, 0.97)" 1030 | ], 1031 | "datasource": "Prometheus", 1032 | "decimals": null, 1033 | "editable": true, 1034 | "error": false, 1035 | "format": "ms", 1036 | "gauge": { 1037 | "maxValue": 100, 1038 | "minValue": 0, 1039 | "show": false, 1040 | "thresholdLabels": false, 1041 | "thresholdMarkers": true 1042 | }, 1043 | "id": 5, 1044 | "interval": null, 1045 | "links": [], 1046 | "mappingType": 1, 1047 | "mappingTypes": [ 1048 | { 1049 | "name": "value to text", 1050 | "value": 1 1051 | }, 1052 | { 1053 | "name": "range to text", 1054 | "value": 2 1055 | } 1056 | ], 1057 | "maxDataPoints": 100, 1058 | "nullPointMode": "connected", 1059 | "nullText": null, 1060 | "postfix": "", 1061 | "postfixFontSize": "50%", 1062 | "prefix": "", 1063 | "prefixFontSize": "50%", 1064 | "rangeMaps": [ 1065 | { 1066 | "from": "null", 1067 | "text": "N/A", 1068 | "to": "null" 1069 | } 1070 | ], 1071 | "span": 10, 1072 | "sparkline": { 1073 | "fillColor": "rgba(31, 118, 189, 0.18)", 1074 | "full": false, 1075 | "lineColor": "rgb(31, 120, 193)", 1076 | "show": false 1077 | }, 1078 | "tableColumn": "", 1079 | "targets": [ 1080 | { 1081 | "expr": "java_lang_runtime_uptime", 1082 | "intervalFactor": 2, 1083 | "legendFormat": "", 1084 | "refId": "A", 1085 | "step": 20 1086 | } 1087 | ], 1088 | "thresholds": "", 1089 | "title": "Kafka Broker Uptime", 1090 | "transparent": false, 1091 | "type": "singlestat", 1092 | "valueFontSize": "80%", 1093 | "valueMaps": [ 1094 | { 1095 | "op": "=", 1096 | "text": "N/A", 1097 | "value": "null" 1098 | } 1099 | ], 1100 | "valueName": "current" 1101 | } 1102 | ], 1103 | "repeat": null, 1104 | "repeatIteration": null, 1105 | "repeatRowId": null, 1106 | "showTitle": false, 1107 | "title": "New row", 1108 | "titleSize": "h6" 1109 | } 1110 | ], 1111 | "schemaVersion": 14, 1112 | "style": "dark", 1113 | "tags": [], 1114 | "templating": { 1115 | "list": [] 1116 | }, 1117 | "time": { 1118 | "from": "now-15m", 1119 | "to": "now" 1120 | }, 1121 | "timepicker": { 1122 | "refresh_intervals": [ 1123 | "5s", 1124 | "10s", 1125 | "30s", 1126 | "1m", 1127 | "5m", 1128 | "15m", 1129 | "30m", 1130 | "1h", 1131 | "2h", 1132 | "1d" 1133 | ], 1134 | "time_options": [ 1135 | "5m", 1136 | "15m", 1137 | "1h", 1138 | "6h", 1139 | "12h", 1140 | "24h", 1141 | "2d", 1142 | "7d", 1143 | "30d" 1144 | ] 1145 | }, 1146 | "timezone": "browser", 1147 | "title": "Kafka", 1148 | "version": 1 1149 | } --------------------------------------------------------------------------------