title: Understanding GCP Dataproc billing and how it is affected by labels
body: <p>I'm trying to make sure I have a clear understanding of how my organisation gets billed for Google Cloud Platform Dataproc.</p>
  
  <p>We have exported our billing history to BigQuery so that we can analyse it. This morning we had two dataproc clusters running and the screenshot below shows a subset of the billing history for those two clusters. I have filtered on <code>labels.key = "goog-dataproc-cluster-uuid" or labels.key = "goog-dataproc-cluster-name" or labels.key = "goog-dataproc-location"</code>. Here is a subset of the results</p>
  
  <p><a href="https://i.stack.imgur.com/aJ4de.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aJ4de.png" alt="enter image description here"></a></p>
  
  <p>I've drawn boxes around the costs for two kinds of sku. Lets's take a look at the <strong>Standard Intel N1 16 VCPU running in EMEA</strong> items.</p>
  
  <p>I only have two clusters yet for each of those two clusters there are three lines. The reason is that there are three labels applied to each dataproc cluster, hence the costs <strong>1.271852</strong> &amp; <strong>3.815556</strong> appear three times each.</p>
  
  <p>My simple question then is...how do I get the total cost of my dataproc clusters? Do I add up all of these numbers (thus implying that the total cost is split equally over all of the labels) or do I take just one of the values (implying that the cost is repeated for each label)?</p>
  
  <hr>
  
  <p>Here's another way of phrasing my question. Does this query give the total cost of running cluster <code>data-dev-dataplatform-dataproc</code> for one day:</p>
  
  <pre><code>SELECT  sum(cost)
  FROM [dh-billing-179310:billing.gcp_billing_export_XXXXXXXX] 
  WHERE labels.key = "goog-dataproc-cluster-name"
    and labels.value = "data-dev-dataplatform-dataproc" 
    and usage_start_time &gt;= "2018-07-05 00:00:00"
    and usage_end_time &lt;= "2018-07-06 00:00:00"
  </code></pre>
  
  <p>or do I need to include other labels in order to get the total cost?</p>