1.7 KiB
Working with Prometheus
For more information on working with Prometheus metrics, see the documentation.
Access the UI of a Prometheus managed application in Kubernetes
You can connect directly to Prometheus, and view the Prometheus user interface, when using a Prometheus managed application in Kubernetes:
-
Find the name of the Prometheus pod in the user interface of your Kubernetes provider, such as GKE, or by running the following
kubectlcommand in your terminal:kubectl get pods -n gitlab-managed-apps | grep 'prometheus-prometheus-server'The command should return a result like the following example, where
prometheus-prometheus-server-55b4bd64c9-dpc6bis the name of the Prometheus pod:gitlab-managed-apps prometheus-prometheus-server-55b4bd64c9-dpc6b 2/2 Running 0 71d -
Run a
kubectl port-forwardcommand. In the following example,9090is the Prometheus server's listening port:kubectl port-forward prometheus-prometheus-server-55b4bd64c9-dpc6b 9090:9090 -n gitlab-managed-appsThe
port-forwardcommand forwards all requests sent to your system's9090port to the9090port of the Prometheus pod. If the9090port on your system is used by another application, you can change the port number before the colon to your desired port. For example, to forward port8080of your local system, change the command to:kubectl port-forward prometheus-prometheus-server-55b4bd64c9-dpc6b 8080:9090 -n gitlab-managed-apps -
Open
localhost:9090in your browser to display the Prometheus user interface.