Member-only story
Insightful Monitoring of Kubernetes Clusters with Traces
Gain valuable insights into the performance of your Kubernetes cluster with trace monitoring. A guide that helps you optimize your operations for maximum efficiency and productivity.

After delving into Kubernetes I quickly learned how vital it is to monitor everything that is going on inside a cluster. There are numerous combinations of tools one can use to monitor a k8s cluster and in this article, I am going to go through setting up one such method.
The scope of this article in defining the observability of a k8s cluster is restricted to:
- monitoring system-level information using Prometheus
- monitoring application-level information using Prometheus and Jaeger
- visualizing the collected information using Grafana
To create application-level information using Prometheus and Jaeger we are going to write a sample Python Flask application integrating Flask exporter and Jaeger tracing. We are also going to containerize our application and deploy it to our k8s cluster.
Setting up Prometheus
Prometheus collects system-level information and stores it in a time-series database. It does so by tagging the data in chronological order giving us the most accurate information based on time. It has a built-in query language called PromQL vaguely similar to SQL. Prometheus also comes with alerting functionality.
In this article, we have used minikube to set up a k8s cluster. We shall take the following steps to install Prometheus in our k8s cluster:
- Start minikube:
minikube start --cpus 4 --memory 8192
. My Minikube version is v1.27.1 and it runs Kubernetes version v1.25.2 - Deploy Ingress controller:
minikube addons enable ingress
- Install Helm:
curl https://raw.githubusercontent/helm/helm/main/scripts/get-helm-3 | bash
- Validate Helm installation:
helm version
. Mine is v3.11.2 - Create a monitoring namespace:
kubectl create namespace monitoring
- Validate namespace…