Skip to content

Instantly share code, notes, and snippets.

@andrewchilds
Last active September 10, 2021 16:22
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save andrewchilds/11831dc82093e53d41af to your computer and use it in GitHub Desktop.
Save andrewchilds/11831dc82093e53d41af to your computer and use it in GitHub Desktop.
Rollbar RQL Cheat Sheet
# List users by average and maximum session length.
SELECT person, max(client.runtime_ms), avg(client.runtime_ms)
FROM item_occurrence
GROUP BY 1
ORDER BY 2 DESC
# List active date ranges for each deploy.
SELECT client.javascript.code_version, min(timestamp), max(timestamp)
FROM item_occurrence
GROUP BY 1
# List top 100 user agent strings over last week
SELECT client.javascript.browser, count(*)
FROM item_occurrence
WHERE timestamp > unix_timestamp() - 60 * 60 * 24 * 7
GROUP BY 1
ORDER BY 2 DESC
# List counts of arbitrary "statusCode" values from item #1234
SELECT body.message.extra.statusCode, count(body.message.extra.statusCode)
FROM item_occurrence
WHERE item.counter = 1234
GROUP BY 1
LIMIT 1000
@fgilio
Copy link

fgilio commented Mar 25, 2020

Thanks!

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