-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: New Ember docs #2124
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 5d35cf3
Update src/platforms/javascript/guides/ember/index.mdx
k-fish 85c9acd
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish 12c44b4
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish 1fd586d
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish 6f23857
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish d7cf184
Update src/platforms/javascript/guides/ember/ember2.mdx
k-fish ad9a430
Remove extra line from ember2 guide
k-fish 811291b
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish adb85aa
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish 0e02cd2
Add performance to docs
k-fish 7ff4c1c
Add default trace sample rate of 1.0
k-fish 2ad9eb0
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish 76378d7
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish 18b1e9c
Update original Ember2 docs with suggestions
k-fish 5d4590a
Update Ember docs to the new generic format using includes
k-fish 27625d0
Tweak copy a bit
k-fish 5096b24
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish ebcb1cd
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish 72acab0
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish 9a9fb3b
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish f0ca34b
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish 298afb3
Remove redundant copy
k-fish a631321
Re-arrange config docs to be on separate pages for clarity, change wi…
k-fish 8ad7f84
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish 637a1e6
Remove extra line
k-fish d9a4b10
Merge remote-tracking branch 'origin/master' into feat/new-ember-docs
k-fish 2240aa4
Rearrange so all options are under configuration
k-fish 5ad2609
Adjust primer to include that 'transactions' are captured as well
k-fish a9f02a5
Fix links
k-fish 814bff0
Fix links
k-fish ee2f7b9
Fix links (actually)
k-fish 7f91ca4
Update src/includes/getting-started-primer/javascript.ember.mdx
k-fish 574e797
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish 4fbae13
Update src/includes/getting-started-config/javascript.ember.mdx
k-fish 0fc06f4
Update src/platforms/javascript/guides/ember/configuration/ember-opti…
k-fish b8e57a1
Update src/platforms/javascript/guides/ember/configuration/other-vers…
k-fish c3ae629
Update src/wizard/javascript/ember.md
k-fish 4687e96
Delete extra note:
k-fish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/includes/configuration/config-intro/javascript.ember.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
}; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```bash {tabTitle:ember-cli} | ||
ember install @sentry/ember | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
77 changes: 77 additions & 0 deletions
77
src/platforms/javascript/guides/ember/configuration/ember-options.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; | ||
``` |
41 changes: 41 additions & 0 deletions
41
src/platforms/javascript/guides/ember/configuration/other-versions/ember2.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
6 changes: 6 additions & 0 deletions
6
src/platforms/javascript/guides/ember/configuration/other-versions/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Other Versions | ||
sidebar_order: 2 | ||
--- | ||
|
||
<PageGrid /> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.