Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
@brianr
brianr / index.html
Created May 5, 2014 18:39
example rollbar.js person config
<script>
var _rollbarConfig = {
accessToken: "your token here",
captureUncaught: true,
payload: {
environment: "production", // or development, etc.
person: {
id: "123", // required, a string
username: "brian", // optional, a string
email: "brian@rollbar.com" // optional, a string
@brianr
brianr / index.html
Created May 7, 2014 20:53
rollbar.js configuration with cookie
<script>
_rollbarConfig = {
accessToken: "token here",
payload: {
environment: "production", // or 'development', etc.
person: {
id: "123", // required if present, string up to 40 chars
username: "brian", // optional, string up to 255 chars
email: "brian@rollbar.com" // optional, string up to 255 chars
},
@brianr
brianr / gist:dd8cd0cf98a4903bec13
Created May 27, 2014 01:34
rollbar.com / api.rollbar.com IP addresses
50.23.76.197
198.23.74.34
119.81.30.98
37.58.71.74
50.22.2.34
119.81.30.99
37.58.71.75
75.126.67.75
108.168.203.178
192.155.197.237
@brianr
brianr / gist:eea590f22ec4d878c275
Last active August 29, 2015 14:02
Rollbar custom grouping config to have items in different android versions separated
[
{
"title": "{{ default_title }} in version {{ client.android.code_version }}",
"fingerprint": "{{ default_fingerprint }}-androidversion-{{ client.android.code_version }}",
"condition": {
"path": "framework",
"eq": "android"
}
}
]
@brianr
brianr / gist:396c609c5a4e88f799aa
Last active August 29, 2015 14:02
Rollbar custom grouping configuration to have routing errors split by path
[
{
"title": "{{ body.trace.exception.class }} {{ body.trace.exception.message }}",
"fingerprint": "{{ body.trace.exception.class }}-{{ body.trace.exception.message }}",
"condition": {
"path": "body.trace.exception.class",
"eq": "ActionController::RoutingError"
}
}
]
@brianr
brianr / gist:05ec26119ed377db54b5
Created June 17, 2014 17:35
Rollbar custom grouping to separate by ip and context
[{
"title": "{{ default_title }} {{ request.user_ip }} {{ request.context }}",
"fingerprint": "{{ default_fingerprint }} {{ request.user_ip }} {{ request.context }}",
"condition": {
"path": "language",
"eq": "ruby"
}
}]
@brianr
brianr / gist:d8e7a949069215883abe
Last active August 29, 2015 14:03
Rollbar custom grouping to separate ruby errors by context
[{
"title": "{{ default_title }} {{ context }}",
"fingerprint": "{{ default_fingerprint }} {{ context }}",
"condition": {
"path": "language",
"eq": "ruby"
}
}]
@brianr
brianr / gist:9da77548c7ba24253546
Created July 1, 2014 17:38
Tracking Ember.js production errors with Rollbar
// you'll need a Rollbar account (rollbar.com)
// and the rollbar.js snippet in your <head> tag,
// from https://rollbar.com/docs/notifier/rollbar.js/
Ember.onerror = function(error) {
Rollbar.error(error);
}
function ignoreRemoteUncaught(isUncaught, args, payload) {
try {
var filename = payload.data.body.trace.frames[0].filename;
if (isUncaught && !filename.match(/^https?:\/\/www\.mycompany\.com/)) {
// Ignore uncaught errors that are not from www.mycompany.com.
return true;
}
} catch (e) {
// Most likely there was no filename or the frame doesn't exist.
}
rollbar.reportMessageWithPayloadData("here is a string message", {
level: "info",
custom: {
"foo": "bar",
"other stuff": [1,2,3]
}
});