Skip to content

feat: New Ember docs #2124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ec9b836
feat: New Ember docs
k-fish Aug 28, 2020
5d35cf3
Update src/platforms/javascript/guides/ember/index.mdx
k-fish Sep 8, 2020
85c9acd
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish Sep 8, 2020
12c44b4
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish Sep 8, 2020
1fd586d
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish Sep 8, 2020
6f23857
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish Sep 8, 2020
d7cf184
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish Sep 8, 2020
ad9a430
Remove extra line from ember2 guide
k-fish Sep 8, 2020
811291b
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish Sep 15, 2020
adb85aa
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish Sep 15, 2020
0e02cd2
Add performance to docs
k-fish Sep 15, 2020
7ff4c1c
Add default trace sample rate of 1.0
k-fish Sep 22, 2020
2ad9eb0
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish Oct 2, 2020
76378d7
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish Oct 5, 2020
18b1e9c
Update original Ember2 docs with suggestions
k-fish Oct 5, 2020
5d4590a
Update Ember docs to the new generic format using includes
k-fish Oct 5, 2020
27625d0
Tweak copy a bit
k-fish Oct 6, 2020
5096b24
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 6, 2020
ebcb1cd
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 6, 2020
72acab0
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 6, 2020
9a9fb3b
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 6, 2020
f0ca34b
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 6, 2020
298afb3
Remove redundant copy
k-fish Oct 6, 2020
a631321
Re-arrange config docs to be on separate pages for clarity, change wi…
k-fish Oct 7, 2020
8ad7f84
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 8, 2020
637a1e6
Remove extra line
k-fish Oct 8, 2020
d9a4b10
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish Oct 8, 2020
2240aa4
Rearrange so all options are under configuration
k-fish Oct 8, 2020
5ad2609
Adjust primer to include that 'transactions' are captured as well
k-fish Oct 8, 2020
a9f02a5
Fix links
k-fish Oct 8, 2020
814bff0
Fix links
k-fish Oct 8, 2020
ee2f7b9
Fix links (actually)
k-fish Oct 8, 2020
7f91ca4
Update src/includes/getting-started-primer/javascript.ember.mdx
k-fish Oct 8, 2020
574e797
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 8, 2020
4fbae13
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish Oct 8, 2020
0fc06f4
Update src/platforms/javascript/guides/ember/configuration/ember-opti…
k-fish Oct 8, 2020
b8e57a1
Update src/platforms/javascript/guides/ember/configuration/other-vers…
k-fish Oct 8, 2020
c3ae629
Update src/wizard/javascript/ember.md
k-fish Oct 8, 2020
4687e96
Delete extra note:
k-fish Oct 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/includes/configuration/config-intro/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Options are passed to `sentry` inside your environment:

```javascript
ENV['@sentry/ember'] = {
sentry: {
dsn: '___PUBLIC_DSN___',
tracesSampleRate: 1.0, // We recommend adjusting this in production
maxBreadcrumbs: 50,
debug: true,
}
};
```
40 changes: 40 additions & 0 deletions src/includes/getting-started-config/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

This snippet includes automatic instrumentation to monitor the performance of your application, which registers and configures the Tracing integration, including custom [Ember instrumentation](./configuration/ember-options/).

```javascript
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

import { InitSentryForEmber } from '@sentry/ember';

InitSentryForEmber();

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}
```

Then add the following config to your `config/environment.js`:

```javascript
ENV['@sentry/ember'] = {
sentry: {
dsn: '___PUBLIC_DSN___',

// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production,
tracesSampleRate: 1.0,
}
};
```

<Note><markdown>

This SDK uses Ember configuration conventions to manage its automatic instrumentation and other Sentry options, this additional configuration can be found under <PlatformLink to="/configuration/ember-options/">Ember options</PlatformLink>.

</markdown></Note>
3 changes: 3 additions & 0 deletions src/includes/getting-started-install/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```bash {tabTitle:ember-cli}
ember install @sentry/ember
```
7 changes: 7 additions & 0 deletions src/includes/getting-started-primer/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Note>
<markdown>

_Sentry's Ember addon enables automatic reporting of errors, exceptions, and transactions._

</markdown>
</Note>
6 changes: 6 additions & 0 deletions src/platforms/javascript/guides/ember/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: Ember
categories:
- browser
redirect_from:
- /clients/javascript/integrations/ember/
- /platforms/javascript/ember/
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Ember Options
description: "Additional configuration options for the Ember addon."
sidebar_order: 1
---

The `@sentry/ember` addon includes options to manage Ember specific instrumentation; these options are set on the addon config directly. All Sentry SDK options that would be passed to `init` should instead be set in the `sentry` key inside your addon config as in this example:

```javascript
ENV['@sentry/ember'] = {
// Ember specific options
sentry: {
// Sentry options
}
};
```

The following documentation is for Ember specific configuration, for Sentry options, [see basic options](/platforms/javascript/guides/ember/configuration/options)

### Performance Monitoring Considerations

The Sentry tracing integration is already set up via the Ember addon with custom Ember instrumentation for routing, components, and the runloop. It sideloads `@sentry/tracing` as a chunk to instrument your application. If you would like to disable this automatic instrumentation and no longer receive the associated transactions, you can set `disablePerformance` in your config as in this example:

```javascript
ENV['@sentry/ember'] = {
disablePerformance: true
};
```

### Routes

If you would like to capture timings for the `beforeModel`, `model`, `afterModel` hooks as well as `setupController` in one of your Routes, `@sentry/ember` exports a `instrumentRoutePerformance` function which can be used by replacing the default export with a wrapped Route.

```javascript
import Route from '@ember/routing/route';
import { instrumentRoutePerformance } from '@sentry/ember';

class MyRoute extends Route {
model() {
//...
}
}

export default instrumentRoutePerformance(MyRoute);
```

### Classic Components
The render times of classic components are also enabled by default, with a setting to capture render timings only above a certain duration. To change this minimum, you can modify `minimumComponentRenderDuration` in your config.

```javascript
ENV['@sentry/ember'] = {
minimumComponentRenderDuration: 0, // Setting this to zero will capture all classic components.
};
```

To disable component instrumentation you can set `disableInstrumentComponents` in your config.
```javascript
ENV['@sentry/ember'] = {
disableInstrumentComponents: true
};
```

### Runloop
The duration of each queue in your application's runloop is instrumented by default, as long as the duration of the queue is longer than a threshold defined in your config by `minimumRunloopQueueDuration`

```javascript
ENV['@sentry/ember'] = {
minimumRunloopQueueDuration: 0, // Setting this to zero will capture all runloop queue durations
};
```

If you would like to disable runloop instrumentation you can set `disableRunloopPerformance` in your config.
```javascript
ENV['@sentry/ember'] = {
disableRunloopPerformance: true
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Ember 2.x
description: "Learn how to use Sentry's Emberjs integration if you're using Ember 2.x."
redirect_from:
- /clients/javascript/integrations/ember/
---

If you're using `Ember 2.x`, you can use Sentry's Ember integration.

To use Sentry with your Ember application, you will need to use Sentry’s browser JavaScript SDK: `@sentry/browser`.

On its own, `@sentry/browser` will report any uncaught exceptions triggered from your application.
To use ESM imports without any additional configuration, you can use `ember-auto-import`
by installing it with `ember install ember-auto-import`.

Starting with version `5.x` our `Ember` integration lives in its own `@sentry/integrations` package.
Install the package using either `npm` or `yarn`:

```bash {tabTitle:npm}
npm install --save @sentry/integrations
```

```bash {tabTitle:yarn}
yarn add @sentry/integrations
```

Then add to your `app.js`:

```javascript
import * as Sentry from "@sentry/browser";
import { Ember as EmberIntegration } from "@sentry/integrations";

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new EmberIntegration()],
});
```

If you are using the CDN version or the Loader, we provide a standalone file for every integration, to set it up [check out our CDN documentation](/platforms/javascript/install/cdn)

<!-- TODO-ADD-VERIFICATION-EXAMPLE -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Other Versions
sidebar_order: 2
---

<PageGrid />
65 changes: 0 additions & 65 deletions src/platforms/javascript/guides/ember/index.mdx

This file was deleted.

74 changes: 30 additions & 44 deletions src/wizard/javascript/ember.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,46 @@ support_level: production
type: framework
---

To use Sentry with your Ember application, you will need to use Sentry’s browser JavaScript SDK: `@sentry/browser`.

On its own, `@sentry/browser` will report any uncaught exceptions triggered from your application.
In order to use ESM imports without any additional configuration, you can use `ember-auto-import`
by installing it with `ember install ember-auto-import`.

Starting with version `5.x` our `Ember` integration lives in it's own package `@sentry/integrations`.
You can install it with `npm` / `yarn` like:
To use Sentry with your Ember application, you will need to use Sentry’s Ember addon: `@sentry/ember`.

```bash
# Using yarn
yarn add @sentry/browser @sentry/integrations

# Using npm
npm install --save @sentry/browser @sentry/integrations
# Using ember-cli
ember install @sentry/ember
```

Then add this to your `app.js`:
You should `init` the Sentry SDK as soon as possible during your application load up in `app.js`, before initializing Ember:

```javascript
import * as Sentry from "@sentry/browser";
import { Ember as EmberIntegration } from "@sentry/integrations";
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new EmberIntegration()],
});
```
import { InitSentryForEmber } from '@sentry/ember';

In case you are using the CDN version or the Loader, we provide a standalone file for every integration, you can use it
like this:
InitSentryForEmber();

```html
<!-- Note that we now also provide a es6 build only -->
<!-- <script src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.es6.min.js" integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.es6.min.js', 'sha384-base64') }}" crossorigin="anonymous"></script> -->
<script
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
crossorigin="anonymous"
></script>
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}
```

<!-- If you include the integration it will be available under Sentry.Integrations.Ember -->
<script
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/ember.min.js"
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'ember.min.js', 'sha384-base64') }}"
crossorigin="anonymous"
></script>
Then add the following config to your `config/environment.js`:

<script>
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new Sentry.Integrations.Ember()],
});
</script>
```javascript
ENV['@sentry/ember'] = {
sentry: {
dsn: '___PUBLIC_DSN___',

// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
}
};
```

<!-- TODO-ADD-VERIFICATION-EXAMPLE -->
The above configuration captures both error and performance data. To reduce the volume of performance data captured, change `tracesSampleRate` to a value between 0 and 1.