Grafana and Prometheus Setup With Strimzi, a.k.a. Kafka on Kubernetes.
A software developer gives a quick tutorial on how to use Strimzi to integrate Prometheus into a Java-based application. Read on to learn more!
Join the DZone community and get the full member experience.Join For Free
In this article, we will see how quickly we can setup Grafana and Prometheus with Strimzi. So let us quickly go through the steps required for this setup.
1. Start Minikube.
2. Download Strimzi. We can follow steps mentioned in Strimzi docs.
3. Setup the Kafka Cluster now. You can find kafka-ephemeral.yaml with
kafkaExporter and metrics configured.
4. Install the Prometheus operator and the Prometheus server instance. Some important modified YAML files can be found in my personnel GitHub link.
5. Check if Strimzi metrics are available.
6. Now setup Grafana.
7. Connect Grafana with Prometheus as a datasource. Note that in the previous step, we found that the Prometheus service is
prometheus-operated on port 9090. Grafana will use this URL to scrap the Prometheus server.
8. Import Dashboard: In the "examples/metrics/grafana-dashboards" file, there are samples available for the Grafana Dashboard; we can reuse them.
strimzi-kafka-exporter.json for this demonstration.
9. The below allows you to send/receive traffic in Kafka Brokers:
10. Finally, we can view all dashboards with runtime changes.
That's it guys. I hope you find it helpful. There is another article for Prometheus integrations with Java applications which you may find helpful too.
Opinions expressed by DZone contributors are their own.