Viewing metrics with Prometheus 

Using the details available in the notes, you can set up a port-forward, as we have done earlier in this book and access Prometheus directly. The information that was displayed from the notes is shown here:

export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")kubectl --namespace monitoring port-forward $POD_NAME 9090

This will allow you to directly access the Prometheus server with a browser. Run these commands in a terminal, and then open a browser and navigate to http://localhost:9090/.

You can view the current state of what Prometheus is monitoring by looking at the list of targets at http://localhost:9090/targets:

Switch ...

Get Kubernetes for Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.