title: Prometheus Collector fails with "collected metric was collected before with the same name and label values"
body: <p>I have a device that is exposing temperature measurements as a JSON in the following format:</p>
  
  <pre><code>[
    {
      "dataPointId": 123456,
      "values": [
        {
          "t": 1589236277000,
          "v": 14.999993896484398
        },
        {
          "t": 1589236877000,
          "v": 14.700006103515648
        },
        {
          "t": 1589237477000,
          "v": 14.999993896484398
        },
  [..]
  </code></pre>
  
  <p>As you can see, the values contain both a timestamp and the temperature measurement. I would like to expose these measurements via Prometheus metrics, so I am using <code>prometheus/client_golang</code> to build an exporter.</p>
  
  <p>My expectation would be that the <code>/metrics</code> endpoint then exposes something like this from the data above:</p>
  
  <pre><code># HELP my_temperature_celsius Temperature
  # TYPE my_temperature_celsius gauge
  my_temperature_celsius{id="123456"} 14.999993896484398 1589236277000
  my_temperature_celsius{id="123456"} 14.700006103515648 1589236877000
  my_temperature_celsius{id="123456"} 14.999993896484398 1589237477000
  </code></pre>
  
  <p>I implemented a simple <code>prometheus.Collector</code> and I am adding my static metrics without any issues. For the measurements above, <code>NewMetricWithTimestamp</code> seems to be the only way to add metrics with a timestamp, so I am iterating over these values using something like this:</p>
  
  <pre><code>for _, measurements := range dp.Values {
    ch &lt;- prometheus.NewMetricWithTimestamp(
      time.Unix(measurements.T, 0),
      prometheus.MustNewConstMetric(
        collector.temperature,
        prometheus.GaugeValue,
        float64(measurements.V),
        device.DatapointID))
  }
  </code></pre>
  
  <p>However, this leads to the following error that I do not fully understand:</p>
  
  <pre><code>An error has occurred while serving metrics:
  
  1135 error(s) occurred:
  * collected metric "my_temperature_celsius" { label:&lt;name:"id" value:"123456" &gt; gauge:&lt;value:14.999993896484398 &gt; timestamp_ms:1589236877000000 } was collected before with the same name and label values
  * collected metric "my_temperature_celsius" { label:&lt;name:"id" value:"123456" &gt; gauge:&lt;value:14.700006103515648 &gt; timestamp_ms:1589237477000000 } was collected before with the same name and label values
  [..]
  </code></pre>
  
  <ul>
  <li><p>I understand that the <em>metric</em> and <em>label</em> combination must be unique, but as I am also adding a timestamp, does that not count as a unique metric? Is my expectation above even possible?</p></li>
  <li><p>How can I represent these measurements in a Prometheus exporter?</p></li>
  </ul>