You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ember): Update README docs to match sentry-docs (#5315)
There were quite a few updates especially around how config is preferred to be set, this cleans up the README to clarify and match with sentry-docs to avoid confusion.
Copy file name to clipboardexpand all lines: packages/ember/README.md
+36-29
Original file line number
Diff line number
Diff line change
@@ -21,28 +21,41 @@ This package is an Ember addon that wraps `@sentry/browser`, with added function
21
21
As with other Ember addons, run:
22
22
`ember install @sentry/ember`
23
23
24
-
Then add the following config to `config/environment.js`
24
+
Then add the following to your `<your-app>/app.js`
25
25
26
26
```javascript
27
-
ENV['@sentry/ember'] = {
28
-
sentry: {
29
-
dsn:'__DSN__'// replace __DSN__ with your DSN,
30
-
tracesSampleRate:1.0, // Be sure to lower this for your production environment
31
-
}
32
-
};
27
+
import*asSentryfrom"@sentry/ember";
28
+
29
+
Sentry.init({
30
+
dsn:'__DSN__'// replace __DSN__ with your DSN,
31
+
32
+
// Set tracesSampleRate to 1.0 to capture 100%
33
+
// of transactions for performance monitoring.
34
+
// We recommend adjusting this value in production,
35
+
tracesSampleRate:1.0,
36
+
});
33
37
```
38
+
34
39
### Usage
35
40
36
-
To use this SDK, call `InitSentryForEmber` before the application is initialized, in `app.js`. This will load Sentry config from `environment.js` for you.
41
+
To use this SDK, call `Sentry.init` before the application is initialized, in `app.js`. This will allow Sentry to capture information while your app is starting.
42
+
Any additional SDK settings can be modified via the usual config in `environment.js` for you, see the Additional Configuration section for more details.
// We recommend adjusting this value in production,
57
+
tracesSampleRate:1.0,
58
+
});
46
59
47
60
exportdefaultclassAppextendsApplication {
48
61
modulePrefix =config.modulePrefix;
@@ -75,27 +88,12 @@ ENV['@sentry/ember'] = {
75
88
76
89
// All component definitions will be added as spans.
77
90
enableComponentDefinition:true,
78
-
79
-
// See sentry-javascript configuration https://docs.sentry.io/error-reporting/configuration/?platform=javascript
80
-
sentry: {}
81
91
};
82
92
```
83
93
84
-
You can also pass additional configuration for sentry-javascript directly to the `InitSentryForEmber` method.
85
-
This configuration will be merged with `ENV['@sentry/ember'].sentry`:
86
-
87
-
```javascript
88
-
InitSentryForEmber({
89
-
ignoreErrors: [
90
-
/You appear to be offline/,
91
-
],
92
-
})
93
-
```
94
-
95
-
It is recommended to pass all static sentry-javascript configuration directly to `InitSentryForEmber`, and only keeping configuration that depends on the build environment/secrets in `config/environment.js`. Please note that due to how the environment config is serialized, any non-JSON-serializable config (like a regex) will not work properly when being kept in `config/environment.js`.
96
-
97
94
#### Disabling Performance
98
95
96
+
99
97
`@sentry/ember` captures performance by default, if you would like to disable the automatic performance instrumentation, you can add the following to your `config/environment.js`:
100
98
101
99
```javascript
@@ -106,7 +104,9 @@ ENV['@sentry/ember'] = {
106
104
107
105
108
106
### Performance
107
+
109
108
#### Routes
109
+
110
110
If you would like to capture `beforeModel`, `model`, `afterModel` and `setupController` times for one of your routes,
111
111
you can import `instrumentRoutePerformance` and wrap your route with it.
0 commit comments