Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
select item.counter, item.title, count(*)
from item_occurrence
where timestamp >= unix_timestamp() - 86400 * 7
group by 1
@brianr
brianr / gist:4d6cc7af028aa7f441b4
Created February 4, 2015 18:01
Custom grouping to separate by reported level
[
{
"condition": {"path": "notifier.name", "eq": "rollbar-gem"},
"fingerprint": "{{ default_fingerprint }}-{{level}}",
"title": "{{ default_title }} ({{level}})"
}
]
@brianr
brianr / gist:e1fb2f3861b35b826c62
Created January 14, 2015 19:15
Rollbar custom grouping to match Flipboard proxy
[{
"condition": {"path": "client.javascript.browser", "contains": "FlipboardProxy"},
"title": "FlipboardProxy JS error",
"fingerprint": "flipboardproxy js error"
}]
@brianr
brianr / gist:7a261c2ba70a41a2c937
Created January 7, 2015 16:27
Rollbar custom grouping to use exception class and message instead of exception.description
[
{
"condition": {"path": "notifier.name", "eq": "rollbar-browser-js"},
"fingerprint": "{{default_fingerprint}}",
"title": "{{body.trace.exception.class}}: {{body.trace.exception.message}}"
}
]
@brianr
brianr / gist:894d42940b0ff40274a0
Created January 5, 2015 20:42
Rollbar custom grouping config to use full message for php E_NOTICE errors
[{
"condition": {"all": [
{"path": "body.trace.exception.class", "contains": "E_NOTICE"},
{"path": "language", "eq": "php"}
]},
"title": "{{body.trace.exception.class}}",
"fingerprint": "{{default_fingerprint}}-{{body.trace.exception.class}}"
}]
@brianr
brianr / gist:7e8f28d3f86a411ff957
Created December 3, 2014 23:19
Rollbar Terms of Service - Diff of 12/14/2014 revision vs. 12/15/2014
46c46,47
< You retain your rights to any Content you submit, post or display on or through the Services. By submitting, posting or displaying Content on or through the Services, you grant us a worldwide, non-exclusive, royalty-free license (with the right to sublicense) to use, copy, reproduce, process, adapt, modify, publish, transmit, display and distribute such Content in any and all media or distribution methods (now known or later developed).
---
> You retain your rights to any Content you submit, post or display on or through the Services. Except for Content we license to you, we don't claim ownership of any Content that is transmitted, stored, or processed in your account(s). Certain functions available through the Services enable you to grant others access to your Content. If you share your Content with others, they may have access to your Content.
> </p>
49c50,51
< We may modify or adapt your Content in order to transmit, display or distribute it over computer networks and in various media and/or m
@brianr
brianr / gist:848e811cf7748de4f2c2
Created December 3, 2014 18:23
rollbar custom grouping config to match js errors from a list of IP addresses
[
{
"condition": {"all": [
{"path": "request.user_ip", "in": ["101.102.103.0", "101.102.103.1", "101.102.103.2"]},
{"path": "framework", "eq": "browser-js"}
]},
"title": "Browser JS error on one of our IPs",
"fingerprint": "browser js error on one of our IPs"
}
]
@brianr
brianr / gist:319cd1a3b6d3d4bf2980
Last active October 1, 2015 15:21
rollbar instrumentation for angular js exception handler
angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {
return function(exception, cause) {
Rollbar.error(exception, {cause: cause});
throw exception;
};
});
@brianr
brianr / rollbarconfig.js
Last active August 29, 2015 14:09
Rollbar transform to normalize filenames for multitenant sourcemap support
var _rollbarConfig = {
// ...
transform: function(payload) {
var trace = payload.data.body.trace;
if (trace && trace.frames) {
for (var i = 0; i < trace.frames.length; i++) {
var filename = trace.frames[i].filename;
if (filename) {
// we have a frame with a filename
// 1. TODO - check if the filename looks like it's part of our app (and not some external js)
@brianr
brianr / gist:82ff15b17c839ff14748
Created October 27, 2014 18:14
Rollbar RQL: Search for occurrences in last 24 hours by url pattern
select *
from item_occurrence
where timestamp >= unix_timestamp() - 24 * 60 * 60
and request.url like '%mydomain.com%'