@sentry/ember 7.1.1 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -29
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -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
|
|
24
|
+
Then add the following to your `<your-app>/app.js`
|
|
25
25
|
|
|
26
26
|
```javascript
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
import * as Sentry from "@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 `
|
|
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.
|
|
37
43
|
|
|
38
44
|
```javascript
|
|
39
45
|
import Application from '@ember/application';
|
|
40
46
|
import Resolver from 'ember-resolver';
|
|
41
47
|
import loadInitializers from 'ember-load-initializers';
|
|
42
48
|
import config from './config/environment';
|
|
43
|
-
import
|
|
49
|
+
import * as Sentry from "@sentry/ember";
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
Sentry.init({
|
|
52
|
+
dsn: '__DSN__' // replace __DSN__ with your DSN,
|
|
53
|
+
|
|
54
|
+
// Set tracesSampleRate to 1.0 to capture 100%
|
|
55
|
+
// of transactions for performance monitoring.
|
|
56
|
+
// We recommend adjusting this value in production,
|
|
57
|
+
tracesSampleRate: 1.0,
|
|
58
|
+
});
|
|
46
59
|
|
|
47
60
|
export default class App extends Application {
|
|
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.
|
|
112
112
|
|
|
@@ -124,11 +124,13 @@ export default instrumentRoutePerformance(MyRoute);
|
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
#### Runloop
|
|
127
|
+
|
|
127
128
|
The runloop queue durations are instrumented by default, as long as they are longer than a threshold (by default 5ms).
|
|
128
129
|
This helps (via the render queue) capturing the entire render in case component render times aren't fully instrumented,
|
|
129
130
|
such as when using glimmer components.
|
|
130
131
|
|
|
131
132
|
If you would like to change the runloop queue threshold, add the following to your config:
|
|
133
|
+
|
|
132
134
|
```javascript
|
|
133
135
|
ENV['@sentry/ember'] = {
|
|
134
136
|
minimumRunloopQueueDuration: 0, // All runloop queue durations will be added as spans.
|
|
@@ -136,9 +138,11 @@ ENV['@sentry/ember'] = {
|
|
|
136
138
|
```
|
|
137
139
|
|
|
138
140
|
#### Components
|
|
141
|
+
|
|
139
142
|
Non-glimmer component render times will automatically get captured.
|
|
140
143
|
|
|
141
144
|
If you would like to disable component render being instrumented, add the following to your config:
|
|
145
|
+
|
|
142
146
|
```javascript
|
|
143
147
|
ENV['@sentry/ember'] = {
|
|
144
148
|
disableInstrumentComponents: true, // Will disable automatic instrumentation for components.
|
|
@@ -147,6 +151,7 @@ ENV['@sentry/ember'] = {
|
|
|
147
151
|
|
|
148
152
|
Additionally, components whose render time is below a threshold (by default 2ms) will not be included as spans.
|
|
149
153
|
If you would like to change this threshold, add the following to your config:
|
|
154
|
+
|
|
150
155
|
```javascript
|
|
151
156
|
ENV['@sentry/ember'] = {
|
|
152
157
|
minimumComponentRenderDuration: 0, // All (non-glimmer) component render durations will be added as spans.
|
|
@@ -154,9 +159,11 @@ ENV['@sentry/ember'] = {
|
|
|
154
159
|
```
|
|
155
160
|
|
|
156
161
|
#### Glimmer components
|
|
162
|
+
|
|
157
163
|
Currently glimmer component render durations can only be captured indirectly via the runloop instrumentation. You can
|
|
158
164
|
optionally enable a setting to show component definitions (which will indicate which components are being rendered) be
|
|
159
165
|
adding the following to your config:
|
|
166
|
+
|
|
160
167
|
```javascript
|
|
161
168
|
ENV['@sentry/ember'] = {
|
|
162
169
|
enableComponentDefinition: true, // All component definitions will be added as spans.
|
|
@@ -165,7 +172,7 @@ ENV['@sentry/ember'] = {
|
|
|
165
172
|
|
|
166
173
|
### Supported Versions
|
|
167
174
|
|
|
168
|
-
`@sentry/ember` currently supports Ember **
|
|
175
|
+
`@sentry/ember` currently supports Ember **4.0+** for error monitoring.
|
|
169
176
|
|
|
170
177
|
### Previous Integration
|
|
171
178
|
|
|
@@ -174,8 +181,8 @@ this Ember addon to offer more Ember-specific error and performancing monitoring
|
|
|
174
181
|
|
|
175
182
|
## Testing
|
|
176
183
|
|
|
177
|
-
|
|
178
|
-
application, you must pass the dsn as an environment variable.
|
|
184
|
+
For this package itself, you can find example instrumentation in the `dummy` application, which is also used for testing.
|
|
185
|
+
To test with the dummy application, you must pass the dsn as an environment variable.
|
|
179
186
|
|
|
180
187
|
```javascript
|
|
181
188
|
SENTRY_DSN=__DSN__ ember serve
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/ember",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "Official Sentry SDK for Ember.js",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/ember",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@embroider/macros": "~0.47.2",
|
|
33
|
-
"@sentry/browser": "7.
|
|
34
|
-
"@sentry/tracing": "7.
|
|
35
|
-
"@sentry/types": "7.
|
|
36
|
-
"@sentry/utils": "7.
|
|
33
|
+
"@sentry/browser": "7.3.1",
|
|
34
|
+
"@sentry/tracing": "7.3.1",
|
|
35
|
+
"@sentry/types": "7.3.1",
|
|
36
|
+
"@sentry/utils": "7.3.1",
|
|
37
37
|
"ember-auto-import": "~1.12.1 || ~2.2.0",
|
|
38
38
|
"ember-cli-babel": "~7.26.6",
|
|
39
39
|
"ember-cli-htmlbars": "^6.0.1",
|