Alerting rules based on dynamic time-based labels

40 views
Skip to first unread message

Jo

unread,
Feb 8, 2022, 3:28:24 AM2/8/22
to Prometheus Users
Hi,

We are trying to create an alerting rule based on dynamic labels. Here is our metric:
my_metric{id='123', date='2021-01-01'} 0.8

We want to ensure that every day at x am, a metric with the corresponding date has a value exceeding a certain threshold. Effectively, it means writing a rule with a dynamic date label.

We came up with a workaround, which consists in producing a separate metric whose value carries the date label's corresponding epoch timestamp: my_metric_timestamp{id='123', date='2021-01-01'} 1640995200
We then join it with my_metric.

This is definitely not ideal; would you have any suggestions? Thank you.
Reply all
Reply to author
Forward
0 new messages