Skip to content

Prometheus

"Prometheus, a Cloud Native Computing Foundation project, is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true." - https://github.com/prometheus/prometheus

Tips

Restart prometheus pods in kubernetes

kubectl get pods -l component=prometheus -o name |
while read -r pod ; do
  echo $pod
  kubectl port-forward "$pod" 9090 &
  sleep 10  # to let the port-forward establish before using it
  curl -X POST localhost:9090/-/reload
  kill %%
  sleep 5  # to let the previous process exit before starting another port forward
done

Validate a prometheus config

promtool check config --syntax-only prometheus-config.yaml