title: on prometheus how to pull a metric based on a specific label
body: <p>Team,</p>
  <p>I formed a query and also have result but am not able to go further by filtering it by a label.</p>
  <p>I want to further filter my result based on mountpoint / and /raid.. how can i?
  query</p>
  <pre><code>(kube_pod_info{namespace=&quot;monitoring&quot;,node=~&quot;(team|wkr).*&quot;}
  * 
  on(pod) group_right(node) 
  (
  max by(instance, namespace, pod, device, mountpoint) (
  (
    node_filesystem_size_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;} 
    - 
    node_filesystem_avail_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;}
  ) 
  / 
  node_filesystem_size_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;}
  )
  ))
  </code></pre>
  <p>output</p>
  <pre><code>{device=&quot;/dev/sdb1&quot;,instance=&quot;101.1.1.1:1401&quot;,mountpoint=&quot;/raid&quot;,namespace=&quot;monitoring&quot;,node=&quot;team11&quot;,pod=&quot;prometheus-node-exporter-dcp-173-4l2dr&quot;} 
  {device=&quot;/dev/sdb1&quot;,instance=&quot;101.1.1.1:1401&quot;,mountpoint=&quot;/&quot;,namespace=&quot;monitoring&quot;,node=&quot;team11&quot;,pod=&quot;prometheus-node-exporter-dcp-173-4l2dr&quot;} 
  </code></pre>
  <p>The work around am using is below</p>
  <pre><code>yes want to see based on either of those two [/ or /raid] like using grep on results obtained..but i figure out a work around by setting them in expression itself like below
  
  ```node_filesystem_size_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;, mountpoint=&quot;/raid&quot;`
  </code></pre>
  <p>so full expression would be</p>
  <pre><code>(kube_pod_info{namespace=&quot;monitoring&quot;,node=~&quot;(team|wkr).*&quot;}
  * 
  on(pod) group_right(node) 
  (
  max by(instance, namespace, pod, device, mountpoint) (
  (
    node_filesystem_size_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;,mountpoint=&quot;/raid&quot;} 
    - 
    node_filesystem_avail_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;,mountpoint=&quot;/raid&quot;}
  ) 
  / 
  node_filesystem_size_bytes{fstype=~&quot;ext[234]|btrfs|xfs|zfs&quot;,mountpoint=&quot;/raid&quot;}
  )
  ))
  </code></pre>