Question

Alert for missing events?

  • 13 September 2017
  • 1 reply
  • 73 views

We’re struggling to figure out a solution to identify when one or more events are low or missing from a table.



Let’s say we want to confirm that these events all have 1,000+ records per day:





  • event_a


  • event_b


  • event_c




  • event_z




We filter eventname for events a through z with an event_count of less than 1000, but our alert will only trigger if there’s 1 to 999 events for a given eventname. If event_a has 0 events, it won’t trigger as an alert.



We can’t think of a dynamic solution short of setting up one alert per eventname, which is costly (bigquery) and inefficient, or one measure per eventname, which is just inefficient. We could create a “count of eventnames” and always confirm the result is the number of events we’re filtering for, but that won’t consider the number of events per eventname.



Any other ideas?


1 reply

Userlevel 3

Hey @Scott_Schaen,



If you have a complete list of event names you want to track, I would recommend putting them into an “event_name” view, then left joining it to your view with the event records. Something like this:



explore: event_name: {


join: event_records: {


type: left_outer


relationship: one_to_many


sql_on: ${event_name.name} = ${event_records.event_name} ;;


}


}



The left join will leave a blank row for any event names that have no event records. Then you can select event_name.name and event_records.count to get a count of 0 for the event names with no records.

Reply