List of ad hoc filters passing an alerts threshhold in grafana


I am building an alerts system, and would like to see a list of the highest values for an ad hoc filter on grafana. For example if I want to count the number of transactions, grouped by day, I would like to see the top ten countries, and have the option to look at their graphs in grafana.


@Basketball23 Would you mind sharing in a bit more detail what you are trying to do? It sounds like to you want your alert to link to some graphs.

Hi Jack! @jackzampolin

I am looking at historical data for number of transactions per day. These transactions have many tags/fields related to them, such as country, email domain, successful/unsuccessful. If I see a spike in any of these fields, I would like to know about it (an alert).

To start with, I am looking at historical data to look for spikes in different fields. For example, if I wanted to look for a spike in transactions per day by country, I would have to go into the ad hoc filters, and one-by-on click on each country, until I had manually checked each country for past spikes.

My method is to divide (# of payments per day)/(average # of payments in the trailing two weeks) to get an order of magnitude. I would like to be able to set a thresh-hold (3), which could make a list of all the countries which at some point had an order of magnitude of 3.0x the average number of payments in a day, so that I could check them manually.

Let me know if I can improve the terms I’m using to be more clear. Thanks for the help!

As part of my previous post, I would also like to know how to do arithmetic calculations between two queries on grafana, for example.

A: (# of payments per day)
B: (average # of payments in the trailing two weeks)
C: A/B


But not for singlestat :frowning: