redash icon indicating copy to clipboard operation
redash copied to clipboard

Alerting/visualizing on row counts rather than just field values

Open tsibley opened this issue 9 years ago • 6 comments

It'd be great to have alerts which could trigger when the number of rows a query returns crosses a certain threshold. This would better support queries which return “suspicious” rows that need further investigation by a human. Currently to accomplish that, you basically need two queries: one for actually grabbing the data (that the human can look at) and one for triggering the alert which just aggregates the first with count() (or does something clever like inspect redash's own metadata about the first query). With two queries, there's lots of potential for divergence over time. You can also hack it by including a window function in your select list (such as row_number() over ()) and alerting on that, but it's kinda ugly.

tsibley avatar Mar 07 '16 19:03 tsibley

The ability to use the number of rows a query returns, instead of a field value from a row, would also be useful for the Counter visualization type. It can be useful to show just the row count of a query on a dashboard, and disclose the query results upon clicking through.

tsibley avatar Mar 08 '16 22:03 tsibley

I'd like to second this feature -- redash is almost perfect for our use case except we have non-SQL literate people using it who need to be able to visualize aggregates as well as values based on queries engineering writes.

gizmodude4 avatar Feb 09 '17 16:02 gizmodude4

Closing. #1619

deecay avatar Nov 15 '18 00:11 deecay

Hey, this feature still isn't resolved, the row counter is only in counter visualization but not in alerts. Can you reopen it, please?

yoavbls avatar Dec 07 '18 16:12 yoavbls

It would be great to have this on the query api as well. For example I have redash integrated with our own internal reporting system.. The internal reporting app can schedule running of reports, and exporting to excel and attaching to a email. If the result of the query is zero rows, I'd like to not send out the email, so that it can be used for exception reporting, when there is actual useful data available.

Thanks!

cjpit avatar Feb 26 '19 02:02 cjpit

Would also be nice to have as a limiter for queries in general so users don't OOM the instance on some troublesome datasets with light data but a lot of rows

puttehi avatar Jan 26 '22 06:01 puttehi