Node level metrics are not available in Prometheus (installed with Istio 1.6)

8/1/2020

I installed Istio 1.6, using istioctl install --set profile=demo. But I could only couple of metrics related to Kubernetes nodes. I can see configuration related Kubernetes Node:

kubernetes_sd_configs:
  - role: node   relabel_configs:
  - action: labelmap
    regex: __meta_kubernetes_node_label_(.+)
  - target_label: __address__
    replacement: kubernetes.default.svc:443
  - source_labels: [__meta_kubernetes_node_name]
    regex: (.+)
    target_label: __metrics_path__
    replacement: /api/v1/nodes/${1}/proxy/metrics

Do I need to install node exporter daemonset?

Thanks

-- Pragmatic
istio
kubernetes
prometheus

1 Answer

8/1/2020

You must have missed some step. I reproduced and it is looking good on my end. <br>

Double check this steps:

Verify that the Prometheus service is running in the cluster:

$ kubectl -n istio-system get svc prometheus

Launch the Prometheus UI

istioctl dashboard prometheus

Execute a Prometheus query(click <kbd>Execute</kbd> ). E.g.:

istio_requests_total

Generate some traffic against the product page:

export INGRESS_HOST=$(minikube ip)
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT

curl http://$GATEWAY_URL/productpage

Edit: for node metrics

Yes, you are right: node exporter is not included.
Fastest way to add it manually is using Helm(literally one line after helm is prepared):

// Install helm
curl -L https://git.io/get_helm.sh | bash

// Install tiller
helm init

// Deploy node-exporter
helm install stable/prometheus-node-exporter

// Launch prometheus
istioctl dashboard prometheus

// Or even better, grafana
istioctl dashboard grafana

If you are using grafana, you can import dashboard ID: 11074 for a fancy display of the data gathered from node exporter:

enter image description here

-- Neo Anderson
Source: StackOverflow