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