Episode 52 : Instrumenting with Prometheus
- Hosted by @krisnova
- Recording date: 2018-10-05
Table of Contents
- 00:00:00 - Welcome to TGIK!
- 00:00:00 - Week in Review
K8s news
Show Notes
Set up cluster with Prometheus
Create a cluster in AWS with Kubicorn
kubicorn create prom-cluster -paws
kubicorn apply prom-cluster
Install Prometheus and other apps
kubectl apply -f bundle.yaml
kubectl apply -f prometheus.yaml
Poke a hole in the firewall
- Open the Node security group
- Expose the TCP Ports to each LoadBalancer created
- 9093 -> alertmanager
- 3000 -> grafana
- 9090 -> prometheus
Change the Makefile to fit your docker registry if needed, and build the example app
make container push
Deploy the example app
kubectl run tgik-app -n monitoring --image krisnova/tgik-instrumentation-app
kubectl expose -n monitoring tgik-app --port 9093 --target-port 1313
To reload the application
kubectl scale tgik-app -n monitoring --replicas=0
kubectl scale tgik-app -n monitoring --replicas=1
To reload Prometheus without taking it down:
curl -i -X POST localhost:9090/-/reload
Do not expose these lifecycle endpoints to the public
Reference Links
https://github.com/prometheus/client_golang/blob/master/prometheus/go_collector.go#L272