Hi

78 views
Skip to first unread message

h0ksa

unread,
Feb 14, 2024, 5:16:01 AM2/14/24
to Prometheus Users
Hi all ,


I have a dataset with 5000 rows, and my objective is to determine if any new rows have been inserted or created within the last 5 minutes. The previously suggested function may not be suitable because the row count is never expected to drop below 1. Consequently, my focus is on identifying instances where no rows have been created within a 5-minute timeframe. If no new rows are found during this period, I intend to initiate an alert. So which function to use
increase()
delta()
increase()  or another one .

Brian Candler

unread,
Feb 14, 2024, 6:31:53 AM2/14/24
to Prometheus Users
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.

h0ksa

unread,
Feb 14, 2024, 6:37:32 AM2/14/24
to Prometheus Users
sum by (table) (increase(pinot_server_realtimeRowsConsumed_Count[5m])) 

right now iam using this query 

and rows are always rising in the database but i want to know when they stop and trigger an alert 

Brian Candler

unread,
Feb 14, 2024, 8:28:33 AM2/14/24
to Prometheus Users
I'm not sure why you're summing over increase, but if you plot that PromQL expression in the web UI, does its value drop to zero when the problem occurs?

If so, just add "== 0" to the end of this expression and you can use it as an alerting expression.

h0ksa

unread,
Feb 14, 2024, 8:39:21 AM2/14/24
to Prometheus Users
I apologize if my explanation was unclear. I currently have four tables for web analytics data. I aim to create a query that triggers an alert when either the data retrieval stops or the number of rows falls below one. Any recommendations on how to formulate this query?

Brian Candler

unread,
Feb 14, 2024, 12:05:31 PM2/14/24
to Prometheus Users
Sorry, I still don't understand what your metrics currently represent, and what condition (in terms of the values of those metrics) you need to alert on. Perhaps if you give some specific examples of those metrics it would help, both in a normal condition, and an error condition.
Reply all
Reply to author
Forward
0 new messages