title: How to get rate of individual metrics in prometheus/grafana while using a wildcard?
body: <p>I've got a number of counters in my service that are incrementing everytime I receive a price update. Using <code>prometheus/client_golang</code>, I create these counters like this:</p>
  <pre><code>priceCounter := promauto.NewCounter(prometheus.CounterOpts{
          Name: fmt.Sprintf(&quot;my_thing_%s_%s_price_update_total&quot;, exchange, stock),
      })
  </code></pre>
  <p>In grafana, I filter for <code>{__name__=~&quot;my_thing.*price_update_total&quot;}</code> - this works, and I can see my counters going up, but I'd like to apply a <code>rate()</code> to it, ie: <code>rate({__name__=~&quot;my_thing.*price_update_total&quot;}[1m])</code></p>
  <p>But when doing this, I get the error &quot;vector cannot contain metrics with the same labelset&quot;. I found this quote <code>rate() keeps all labels except __name__, but it drops __name__ to avoid any confusion.</code>, but I'm not sure how to proceed.</p>
  <p>I tried applying rate() to these metrics without wildcards, and it works, but I have far too many to do my hand. Does this mean I need to add a namespace and a subsystem for every different price that I want metrics on? I'm quite new to prometheus and still trying to figure my way around things, and have hit a wall.</p>