what expression should I use to output two metrics in grafana from prometheus

2/12/2022

I installed a test cluster using Minikube. Also I've installed Prometheus, Grafana & Loki using helm chart. I want to output two metrics, but I don't know how. First metric is half done, but for some reason, it is not output if you put the mount point "/", and I need the metric itself with it, which is needed:

1) Percentage of free disk space — mount point ‘/’, exclude tmpfs

    node_filesystem_avail_bytes{fstype!='tmpfs'} / node_filesystem_size_bytes{fstype!='tmpfs'} * 100

2) second metric: Number of API servers running. I don't know how to get it out.

-- Iceforest
grafana
kubernetes
minikube
prometheus
promql

1 Answer

2/15/2022

I solved the problem on my own first metric they did not change it, since there is no such mountpoint /

second metric count(kube_pod_info{pod=~".apiserver.",namespace=".."})

-- Iceforest
Source: StackOverflow