What Prometheus metrics are you collecting? For example, do you have a metric for the total number of rows in the database? Or do you have a metric for the last time a row was inserted? Or some other metric which can identify new rows - if so, what?
What is the "previously suggested function"?
We can't really suggest an alerting function without seeing the metrics themselves.