title: Prometheus filtering based on Labels
body: <p>How to add label filters in Prometheus query?</p>
  
  <p><strong>kube_pod_info</strong> </p>
  
  <blockquote>
    <p>kube_pod_info{created_by_kind="ReplicaSet",created_by_name="alertmanager-6d9f74d4c5",instance="kube-state-metrics:8080",job="kube-state-metrics",namespace=“test",pod="alertmanager-6d9f74d4c5-xlqrv"}</p>
  </blockquote>
  
  <p><strong>kube_pod_labels</strong></p>
  
  <blockquote>
    <p>kube_pod_labels{instance="kube-state-metrics:8080",job="kube-state-metrics",label_app="alertmanager",label_pod_template_hash="6d9f74d4c5",namespace=“test",pod="alertmanager-6d9f74d4c5-xlqrv”,label_source=“k8s"}</p>
  </blockquote>
  
  <p>Here, I have kube state metrics info in prometheus for kube_pod_info &amp; kube_pod_labels.</p>
  
  <p><code>kube_pod_info{namespace="test"}</code>  ---> Filters pods by namespace test.</p>
  
  <p>Here, I want to include filter based on labels as well. I have a label called "label_source=“k8s" in kube_pod_labels. How can I join kube_pod_info &amp; kube_pod_labels to apply label filter as well?</p>