Say I have a metrics request_failures
for users. For each user I add a unique label value to the metrics. So for user u1, when a request failed twice, I get the following metrics:
request_failures{user_name="u1"} 2
I also have a rule that fires when there are new failures. Its expression is:
increase(request_failures[1m]) > 0
This works well for a user that already encountered failures. For example, when u1 encounters the third failure, the rule fires.
When a request failed for a new user u2, I get the metrics as:
request_failures{user_name="u1"} 2
request_failures{user_name="u2"} 1
Now the problem is that the alert rule doesn't fire for u2. It seems that the rule cannot recognize a "new metrics", although all the three metrics are identically request_failures, just with different labels.
Anyone can point out how I should construct the rule?