How to alert on logs with Duration less than 5 minutes in Grafana?

If I ingest a log, and part of that log has a label called “Duration” that tells me the length of the call, is it possible to alert if the Duration is less thatn 5m?

Yes, that should be pretty easy to create an alert for.

Yeah I think I figured it out. I did count_over_time({my_query}[1h])

i think that should work

I think that’s going to return the amount of times that query happened over 1h. I’m not sure that’s what you want?

Yeah it’s not perfect

But i can’t seem to figure out how to tell it to alert on the duration. at least for this alert it will say “x number of calls had a duration under 5m in the past hour”

Something like max of duration over 5 minutes should do it I’d think. if I understand what you want to alert on. Or maybe min depending on what you want.