I have a set of metrics that are being sent only when there is an issue. I want to create an expression that will capture the number of issues in the last 15 minutes. For efficiency I would like to use a regex with the metrics names (let’s asume that there will be no performance problems) . After I have the count I would like to know if I had more than 9 issues in the 15 minutes interval
- I am starting from this expression, label_join({name=~“node_load\d+”,instance=“172.31.2.79:9100”},“metricname”,“”,“name”) which adds the metric name as a label to each metric. I will use it later in a by (metricname)
- My goal now is to count the number of samples for each metric in the last 15 minutes (the number of samples represents the number of issues). I can’t find where the put the range [15m] without getting a syntax error.
Any help will be appreciated.