Time based threshold in Singlestat panel

Hi all,

I’ve counter metrics suppose for example:

this metric is pushed to prometheus through pushgateway.

Now I want to use this metric in Grafana with Singlestat in such a way that:
if the time of sample_data_created < 10 min then singlestat panel should turn red if it is less than 30 min it should turn to yellow and if it is less than 1 hour then it should turn green.

I would really very appreciate it if someone please guide me on how can I achieve this or apart from singlestat panel is there any other workaround of this.

1 Like