Diplay interface Prometheus


#1

Hello friends, I have a problem.
I can not display the prometheus interface for monitoring the Bookinfo application on AKS. the problem lies in the kubectl -n istio-system port-forward, I have this result
Forwarding from 127.0.0.1.19090 -> 9090
Forwarding from [::]: 9090 -> 9090
But I can not display the prometheus interface with http: // localhost: 9090 / graph
Someone already has the same situation as me,
Thank you for your guidance


#2

if you are forwarding from 19090, you’ll need to check localhost:19090 (and not localhost:9090) right?


#3

Thanks @douglas-reid for reaction but I have another problem.
When I execute the command
kubectl port-forward -n monitoring prometheus-prometheus-operator-prometheus-0 9090 on my cluster Kubernetes (AKS) it gives me this result
Forwarding from 127.0.0.1.19090 -> 9090
Forwarding from [:: 1]: 9090 -> 9090
and when I put the URL http://127.0.0.1:9090/targets on my browser, I have no result.

$ kubectl get pods -n monitoring
NAME READY STATUS RESTARTS AGE
alertmanager-prometheus-operator-alertmanager-0 2/2 Running 0 11h
prometheus-operator-grafana-8549568bc7-zntgz 2/2 Running 0 11h
prometheus-operator-kube-state-metrics-5fc876d8f6-v5zh7 1/1 Running 0 11h
prometheus-operator-operator-75d88ccc6-t4lt5 1/1 Running 0 11h
prometheus-operator-prometheus-node-export-zqk7t 1/1 Running 0 11h
prometheus-prometheus-operator-prometheus-0 3/3 Running 1 11h

What should be done ? or how to forwarding prometheus from my public cloud to my local machine.
Thank you


#4

Again, I think you need to visit port 19090 locally, not 9090.

Your kubectl command appears to result in different ports being mapped (IPv4 vs IPv6). Look closely at the output:

Forwarding from 127.0.0.1.19090 -> 9090
Forwarding from [:: 1]: 9090 -> 9090

In your cmd (kubectl port-forward -n monitoring prometheus-prometheus-operator-prometheus-0 9090), you are omitting [LOCAL_PORT].

If you absolutely must use port 9090, your command should be:

kubectl port-forward -n monitoring prometheus-prometheus-operator-prometheus-0 9090:9090

Please consult the docs for more assistance: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#port-forward

port-forward TYPE/NAME [options] [LOCAL_PORT:]REMOTE_PORT […[LOCAL_PORT_N:]REMOTE_PORT_N]