title: Prometheus : how do i sum by with 2 different metrics
body: <p>I have 2 different metrics : 
  metric_a with a field type
  metric_b with a field type (same one)</p>
  
  <p>I'm trying to summarise a and b, of the same type.
  If type exists only on metric_a and not on metric_b - it should return metric_b's result.
  I've tried a lot of options on prometheus: </p>
  
  <p><code>sum by (type)(metric_a{job=~"provision-dev"}) or vector(0) + sum by(type)(metric_b{job=~"provision-dev"}) or vector(0)</code> : returns only the values from metric_a, and doesn't calculate metric_b's results.</p>
  
  <p><code>sum by (type)(metric_a{job=~"provision-dev"}) + sum by(type)(metric_b{job=~"provision-dev"})</code> : returns only the values from metric_b, and doesn't calculate metric_a's results.</p>
  
  <p><code>sum by (cluster_id)(provision_scale_out_failures{job=~"provision-dev"} + provision_scale_out_success{job=~"provision-dev"})</code> : well this isn't even a right query</p>
  
  <p>Basically here's an example of a success : </p>
  
  <p>metric_a : </p>
  
  <ul>
  <li>type = type_1, sum = 5</li>
  <li>type = type_2, sum = 2</li>
  </ul>
  
  <p>metric_b : </p>
  
  <ul>
  <li>type = type_1, sum = 4</li>
  <li>type = type_3, sum = 3</li>
  </ul>
  
  <p>result of the query : </p>
  
  <ul>
  <li>type = type_1, sum = 9</li>
  <li>type = type_2, sum = 2</li>
  <li>type = type_3, sum = 3</li>
  </ul>