title: left join prometheus metrics in grafana?
body: <p>I'm using prometheus in grafana to track smart data for drives in a couple servers.   I'm trying to create a table that shows me which drives have >0 reallocated sectors... here are the queries i use:
  <a href="https://i.stack.imgur.com/veOcd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/veOcd.png" alt="enter image description here"></a></p>
  
  <pre><code>sum(smartmon_reallocated_sector_ct_raw_value&gt;0) by (disk)
  
  sum(smartmon_device_info) by (device_model, disk, model_family, serial_number)
  </code></pre>
  
  <p>This results in a table like the following:
  <a href="https://i.stack.imgur.com/FNs9O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FNs9O.png" alt="enter image description here"></a></p>
  
  <p>I'm using an outer join in grafana to merge the two queries by disk, but the problem is that the table ends up showing all drives, not just the ones with >0 reallocated sectors (currently only /dev/da8).   Grafana doesn't yet have a left join option, only outer join, so I'm not sure if this is even possible...is it?</p>