Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
select code_version, min(timestamp)
from item_occurrence
group by 1
@brianr
brianr / gist:d7e61965fca488636da8
Last active August 29, 2015 14:18
RQL queries for deploys
-- select all deploys
select * from deploy;
-- select main columns for all deploys of a specific revision
select id, timestamp, environment, comment from deploy
where revision = 'some git sha here'
-- deploys of 'production' by revision, and when they were first and last deployed
@brianr
brianr / gist:e2c5ea89a51e167ce655
Created May 8, 2015 18:28
rollbar.js config example - force https
var _rollbarConfig = {
// force rollbar.js to load over HTTPS
rollbarJsUrl: 'https://d37gvrvc0wt4s1.cloudfront.net/js/v1.2/rollbar.min.js',
// force requests to api.rollbar.com to be made over HTTPS
endpoint: 'https://api.rollbar.com/api/1/',
// rest of your configuration here...
accessToken: "12c99de67a444c229fca100e0967486f",
captureUncaught: true,
payload: {
select body.trace.exception.message, count(*)
from item_occurrence
where item.counter = 123456
group by 1
order by 2 desc
select *
from item_occurrence
where timestamp > unix_timestamp() - 86400
and request.params.some_key LIKE '%some_value%'
@brianr
brianr / gist:467bccd47b10015ad77d
Created June 18, 2015 20:40
Rollbar custom grouping to group file:// into a single item
[
{
"condition": {
"path": "body.trace.frames.*.filename",
"contains": "file://"
},
"title": "Error on file://",
"fingerprint": "error-on-local-filesystem"
}
]
@brianr
brianr / gist:58899467f58b80eee1eb
Created July 1, 2015 17:59
rollbar.js checkIgnore to ignore all "Script error" uncaught errors
_rollbarConfig = {
accessToken: 'your token',
captureUncaught: true,
payload: {
environment: 'production',
},
checkIgnore: function(isUncaught, args, payload) {
if (isUncaught && args[0] && args[0].indexOf('Script error') === 0) {
// ignore
return true;
@brianr
brianr / example.json
Last active March 14, 2018 16:14
Rollbar grouping config to include the exception message for node.js errors with class name 'Error'
[{
"condition": {"all": [
{"path": "body.trace.exception.class", "eq": "Error"},
{"path": "framework", "eq": "node-js"}
]},
"title": "{{default_title}}",
"fingerprint": "{{default_fingerprint}}-{{body.trace.exception.message}}"
}]
@brianr
brianr / NamedError.js
Created July 24, 2015 21:22
NamedError - easily set the error 'name' property without defining a new class
function NamedError(name, message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = name;
this.message = message;
this.extra = extra;
};
require('util').inherits(NamedError, Error);
module.exports = NamedError;
@brianr
brianr / README.md
Last active May 17, 2018 00:07
Rollbar IP addresses