Skip to content

Instantly share code, notes, and snippets.

@robclancy
Created February 3, 2021 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robclancy/a7594f1091fbd0e7275e81870425592c to your computer and use it in GitHub Desktop.
Save robclancy/a7594f1091fbd0e7275e81870425592c to your computer and use it in GitHub Desktop.
Ember Sentry
At the bottom.
<script src="https://browser.sentry-cdn.com/5.30.0/bundle.tracing.min.js" integrity="sha384-Wmp0Jx28tGfR086jrVwifMRcSWk8HQW4TWQ6XsNtI90pVj0dgkH9r2+pI3L2CLf6" crossorigin="anonymous"></script>
<script src="https://browser.sentry-cdn.com/5.30.0/ember.min.js" integrity="sha384-AoDWDCFzGgUlcjpTPIOucLHY0TcDkJISfQTounFvJC9id+SLfT+LMV/omYXeSxtk" crossorigin="anonymous"></script>
/*global Sentry*/
import config from 'postedin/config/environment';
export function initialize(application) {
if (typeof Sentry === 'undefined' || ! Sentry || typeof Sentry.init !== 'function' || typeof Sentry.Integrations.Ember === 'undefined') {
return;
}
let options = config.sentry;
options.integrations = [
new Sentry.Integrations.Ember(),
new Sentry.Integrations.BrowserTracing(),
];
options.tracesSampleRate = 1.0;
Sentry.init(options);
application.sentry = Sentry;
}
export default {
initialize,
};
/* eslint-env node */
'use strict';
module.exports = function (environment) {
let ENV = {
// ...
sentry: {
dsn: process.env.SENTRY_EMBER_DSN,
release: process.env.RELEASE || 'local',
ignoreErrors: [
'Ajax operation failed',
'Request was rejected because it was invalid',
'Ajax authorization failed',
'Request was rejected because user is not permitted to perform this operation.',
'Request was formatted incorrectly.',
'Resource was not found.',
'Resource is no longer available.',
'The ajax operation timed out',
'The ajax operation was aborted',
'The ajax operation failed due to a conflict',
'Request was rejected due to server error',
'TransitionAborted',
'Network request failed',
'ResizeObserver loop limit exceeded',
// 'Non-Error exception captured with keys: abort, always, catch, done, fail',
],
},
// ...
};
// ...
return ENV;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment