Prometheus | filter query based on another metric

491 views Asked by At

I have two metrics:

node_filesystem_files

node_filesystem_files{device="/dev/nvme0n1p1",endpoint=“metrics”,fstype=“xfs”,**instance**=“10.64.0.113:9100”,job=“node-exporter”,mountpoint="/",namespace=“observability”,pod=“prometheus-prometheus-node-exporter-kpjhq”,service=“prometheus-prometheus-node-exporter”}

kube_node_role

kube_node_role{endpoint=“http”,**instance**=“10.64.43.50:8080”,job=“kube-state-metrics”,namespace=“observability”,node=“ip-10-64-0-113.ap-southeast-1.compute.internal”,pod=“prometheus-kube-state-metrics-69447598b7-fkshq”,**role**=“solr”,service=“prometheus-kube-state-metrics”}

Problem statement:

I want to filter node_filesystem_files on basis of role which is present in kube_node_role. The common link in both the metrics is instance. Can someone suggest a way or query by which both the metrics can be linked to generate output of node_filesystem_files based on roles.

0

There are 0 answers