Day 16: Getting Started with Prometheus – Monitoring Metrics
Alex Parra
AWS Community Builder | Platform Engineer | Kubernetes | Gitops | DEVOPS | SRE
Welcome to Day 16 of the Zero to Platform Engineer in 30 Days challenge! ?? Today, we’ll explore Prometheus, the go-to tool for monitoring Kubernetes and collecting real-time metrics.
Why Monitoring with Prometheus?
Monitoring is essential to:
?? What Prometheus Provides:
Installing Prometheus in Kubernetes
Step 1: Deploy Prometheus with Helm
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace
kubectl get pods -n monitoring
Step 2: Accessing Prometheus UI
kubectl port-forward svc/prometheus-kube-prometheus-prometheus -n monitoring 9090:9090
?? https://localhost:9090
Step 3: Querying Metrics with PromQL
Run the following PromQL queries to analyze metrics:
sum(rate(node_cpu_seconds_total[5m])) by (instance)
sum(container_memory_usage_bytes) by (pod)
rate(http_requests_total[1m])
Activity for Today
What’s Next?
Tomorrow, we’ll visualize Prometheus metrics with Grafana, creating custom dashboards and alerts.
?? Check it out here: Zero to Platform Engineer Repository
Feel free to clone the repo, experiment with the code, and even contribute if you’d like! ??