O'Reilly logo

Kubernetes for Developers by Joseph Heck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required