How to alarm on a not declining metric?

Is there a way to configure a Grafana alert on a metric to trigger when the value of the metric is not declining over a period of time?

I’m tracking the size of a queue and would like to know when it’s stuck.

This is healthy:

This is not healthy:

How about something like this?

Hi @danielgonzalez. How would that work?
How is the diff() function calculated? I cannot find any reference.
I was more thinking about calculating the slope of the graph and based on that making a decision. Is that possible? (I’m using prometheus as the storage)

Diff is the difference between the two last values… So you can do something like group values by hour (average) and this Diff must be always negative, on other case alarm