This PR adds some of the grafana plugins and also adds some Prometheus configuration relabeling for kube-state-metrics to collect all labels info from all the pods that it collects metrics from.
Grafana plugins that are added are:
grafana-polystat-panel(polystat plugin)
snuids-trafficlights-panel(traffic-light plugin)
How to achieve this - > We should to be able to filter out openebs specific pods to visualise in grafana. For that we can make use of kube_pod_labels metric coming from kube-state-metrics and do a join operation along with other metrics.
In order to list pods with all their labels in Prometheus query we need to do a join operator( group clause) with the required metric and kube_pod_labels(which list all labels of all pods).
Example: kube_pod_info * on (pod,namespace) group_right kube_pod_labels
This would list pods with all its labels
In order to filter out pods with specific labels we need to apply that labels inside the prometheus query itself.
Example: kube_pod_info * on (pod,namespace) group_right kube_pod_labels{label_openebs_io_component_name="ndm-operator"}
This would list only those pods that having the openebs.io/component-name=ndm label
What does this PR do?
This PR adds some of the grafana plugins and also adds some Prometheus configuration relabeling for kube-state-metrics to collect all labels info from all the pods that it collects metrics from.
Grafana plugins that are added are:
How to achieve this - > We should to be able to filter out openebs specific pods to visualise in grafana. For that we can make use of
kube_pod_labels
metric coming fromkube-state-metrics
and do a join operation along with other metrics.kube_pod_labels
(which list all labels of all pods). Example:kube_pod_info * on (pod,namespace) group_right kube_pod_labels
This would list pods with all its labelskube_pod_info * on (pod,namespace) group_right kube_pod_labels{label_openebs_io_component_name="ndm-operator"}
This would list only those pods that having theopenebs.io/component-name=ndm
labelScreenshots for this PR are attached below:
List pods with all their labels![Screenshot from 2021-05-20 14-28-07](https://user-images.githubusercontent.com/44068648/118950270-aa0a9880-b977-11eb-84ce-6c1c64e50ce7.png)
List pods with specific labels only![Screenshot from 2021-05-20 14-27-51](https://user-images.githubusercontent.com/44068648/118950362-c1e21c80-b977-11eb-9a3b-a5f25bf417cb.png)
New grafana plugin added![Screenshot from 2021-05-20 13-45-27](https://user-images.githubusercontent.com/44068648/118950444-d4f4ec80-b977-11eb-840d-9e29f8b30e96.png)
Signed-off-by: Abhishek Agarwal abhishek.agarwal@mayadata.io