Skip to content

Instantly share code, notes, and snippets.

@ajsharma
Last active March 1, 2022 23:12
Show Gist options
  • Save ajsharma/18ebbacc92e2955831975169c4bd0b23 to your computer and use it in GitHub Desktop.
Save ajsharma/18ebbacc92e2955831975169c4bd0b23 to your computer and use it in GitHub Desktop.
Rollbar RQL query to pull number of exceptions that have occurred in the last 60 days
SELECT body.trace.exception.class, count(*), sum(item.total_occurrences), min(timestamp), max(timestamp), level, environment, item.status
FROM item_occurrence
WHERE timestamp > unix_timestamp() - 60 * 60 * 24 * 77
AND item.status = 1
AND language = 'ruby'
AND item.level >= 40
AND environment = 'production'
GROUP BY body.trace.exception.class
LIMIT 500
@krisleech
Copy link

why 60 * 60 * 24 * 77 not 60 * 60 * 24 * 60?

@ajsharma
Copy link
Author

ajsharma commented Mar 1, 2022

Probably no good reason 😓

I think i wanted an extended time window to make sure I captured all the events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment