ember-cli-sentry
An ember-cli addon adding Sentry support.
Requirements
- Node.js 6 or higher is required to use this addon
- Ember CLI 2.13 or higher is required to use this addon
Install
ember install ember-cli-sentry
Usage
TLDR
// config/environment.js module { var ENV = /* config */ sentry: dsn: 'https://<dummykey>@app.getsentry.com/<dummyproject>' }
Complete config
// config/environment.js module { var ENV = /* config */ sentry: /** * The only mandatory parameter. * * @type */ dsn: 'https://<dummykey>@app.getsentry.com/<dummyproject>' /** * Sets Raven.debug property when running `Raven.config`. * * @type * @default true */ debug: true /** * If set to true, it will prevent Raven.js from being initialized. * Errors and logs will be logged to the console (default) instead of * being reported by Raven. * * @type * @default undefined */ development: false /** * Pass the environment to Raven.js * * @type * @default undefined */ environment: environment /** * If set to true, addon will try to have Ember.onerror * and Ember.RSVP.on('error') captured by Raven. * * @type * @default true */ globalErrorCatching: true /** * Raven.js option. * * @type * @default [] */ includePaths: /** * Raven.js option. * * @type * @default [] */ whitelistUrls: /** * Options to pass directly to Raven.js. Note: whitelistUrls and * includePaths in this will take precedence * over the above. * * @default */ ravenOptions: {} }
Content Security Policy
To allow Ravenjs to work properly, you need to add a couple of thing to the content security policy rules:
'script-src': "'self' 'unsafe-inline' 'unsafe-eval'",
'img-src': "data: app.getsentry.com",
'connect-src': "'self' app.getsentry.com"
Meaningless stack traces?
See this issue.
Example
The dummy application in tests is a working example with a couple of logging here and there, and a default logger.