title: How to alert on metrics with a high cardinality in prometheus
body: <p>when trying to create an alert on high metric cardinality with the expression <code>count by(__name__) ({__name__=~&quot;.+&quot;}) &gt; 50</code> I get the error: <code>vector contains metrics with the same labelset after applying rule labels</code>.</p>
  <p>As the expression works when using it directly in prometheus, I wonder if there is an actual way to use it in an alert?</p>