Skip to content

Commit b772a35

Browse files
committed
docs(ember): improve docs for configuring the ember SDK
1 parent 487945f commit b772a35

File tree

1 file changed

+52
-21
lines changed

1 file changed

+52
-21
lines changed

packages/ember/README.md

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,55 @@ export default class App extends Application {
5454

5555
### Additional Configuration
5656

57-
Aside from configuration passed from this addon into `@sentry/browser` via the `sentry` property, there is also the following Ember specific configuration.
57+
Aside from configuration passed from this addon into `@sentry/browser` via the `sentry` property, there is also the following Ember specific configuration:
5858

5959
```javascript
60-
ENV['@sentry/ember'] = {
61-
ignoreEmberOnErrorWarning: false, // Will silence Ember.onError warning without the need of using Ember debugging tools. False by default.
62-
sentry: ... // See sentry-javascript configuration https://docs.sentry.io/error-reporting/configuration/?platform=javascript
63-
};
60+
ENV['@sentry/ember'] = {
61+
// Will silence Ember.onError warning without the need of using Ember debugging tools.
62+
ignoreEmberOnErrorWarning: false,
63+
64+
// Will disable automatic instrumentation of performance.
65+
// Manual instrumentation will still be sent.
66+
disablePerformance: true,
67+
68+
// All runloop queue durations will be added as spans.
69+
minimumRunloopQueueDuration: 0,
70+
71+
// Will disable automatic instrumentation for components.
72+
disableInstrumentComponents: true,
73+
74+
// All (non-glimmer) component render durations will be added as spans.
75+
minimumComponentRenderDuration: 0,
76+
77+
// All component definitions will be added as spans.
78+
enableComponentDefinition: true,
79+
80+
// See sentry-javascript configuration https://docs.sentry.io/error-reporting/configuration/?platform=javascript
81+
sentry: {}
82+
};
83+
```
84+
85+
You can also pass additional configuration for sentry-javascript directly to the `InitSentryForEmber` method.
86+
This configuration will be merged with `ENV['@sentry/ember'].sentry`:
87+
88+
```javascript
89+
InitSentryForEmber({
90+
ignoreErrors: [
91+
/You appear to be offline/,
92+
],
93+
})
6494
```
6595

96+
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`.
97+
6698
#### Disabling Performance
6799

68100
`@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`:
69101

70102
```javascript
71-
ENV['@sentry/ember'] = {
72-
disablePerformance: true, // Will disable automatic instrumentation of performance. Manual instrumentation will still be sent.
73-
sentry: ... // See sentry-javascript configuration https://docs.sentry.io/error-reporting/configuration/?platform=javascript
74-
};
103+
ENV['@sentry/ember'] = {
104+
disablePerformance: true, // Will disable automatic instrumentation of performance. Manual instrumentation will still be sent.
105+
};
75106
```
76107

77108

@@ -100,37 +131,37 @@ such as when using glimmer components.
100131

101132
If you would like to change the runloop queue threshold, add the following to your config:
102133
```javascript
103-
ENV['@sentry/ember'] = {
104-
minimumRunloopQueueDuration: 0, // All runloop queue durations will be added as spans.
105-
};
134+
ENV['@sentry/ember'] = {
135+
minimumRunloopQueueDuration: 0, // All runloop queue durations will be added as spans.
136+
};
106137
```
107138

108139
#### Components
109140
Non-glimmer component render times will automatically get captured.
110141

111142
If you would like to disable component render being instrumented, add the following to your config:
112143
```javascript
113-
ENV['@sentry/ember'] = {
114-
disableInstrumentComponents: true, // Will disable automatic instrumentation for components.
115-
};
144+
ENV['@sentry/ember'] = {
145+
disableInstrumentComponents: true, // Will disable automatic instrumentation for components.
146+
};
116147
```
117148

118149
Additionally, components whose render time is below a threshold (by default 2ms) will not be included as spans.
119150
If you would like to change this threshold, add the following to your config:
120151
```javascript
121-
ENV['@sentry/ember'] = {
122-
minimumComponentRenderDuration: 0, // All (non-glimmer) component render durations will be added as spans.
123-
};
152+
ENV['@sentry/ember'] = {
153+
minimumComponentRenderDuration: 0, // All (non-glimmer) component render durations will be added as spans.
154+
};
124155
```
125156

126157
#### Glimmer components
127158
Currently glimmer component render durations can only be captured indirectly via the runloop instrumentation. You can
128159
optionally enable a setting to show component definitions (which will indicate which components are being rendered) be
129160
adding the following to your config:
130161
```javascript
131-
ENV['@sentry/ember'] = {
132-
enableComponentDefinition: true, // All component definitions will be added as spans.
133-
};
162+
ENV['@sentry/ember'] = {
163+
enableComponentDefinition: true, // All component definitions will be added as spans.
164+
};
134165
```
135166

136167
### Supported Versions

0 commit comments

Comments
 (0)