Ember Options
Configure tracing for Ember routes, classic components, and the runloop.
Pass Sentry SDK options, such as dsn and tracesSampleRate, to Sentry.init() in app/app.ts. See Set Up Sentry for the complete setup and Basic Options for SDK configuration.
Pass Ember performance options to instrumentAppInstancePerformance() as shown below.
To capture page loads, navigation, classic component renders, and runloop timings, call instrumentAppInstancePerformance() from an instance initializer. Set tracesSampleRate or tracesSampler in Sentry.init() to enable tracing.
app/instance-initializers/sentry-performance.tsimport type ApplicationInstance from "@ember/application/instance";
import { instrumentAppInstancePerformance } from "@sentry/ember";
export function initialize(appInstance: ApplicationInstance): void {
instrumentAppInstancePerformance(appInstance, {
// These are the defaults. Adjust them for your application.
disableInstrumentComponents: false,
minimumComponentRenderDuration: 2,
disableRunloopPerformance: false,
minimumRunloopQueueDuration: 5,
});
}
export default { initialize };
import type ApplicationInstance from "@ember/application/instance";
import { instrumentAppInstancePerformance } from "@sentry/ember";
export function initialize(appInstance: ApplicationInstance): void {
instrumentAppInstancePerformance(appInstance, {
// These are the defaults. Adjust them for your application.
disableInstrumentComponents: false,
minimumComponentRenderDuration: 2,
disableRunloopPerformance: false,
minimumRunloopQueueDuration: 5,
});
}
export default { initialize };
The SDK skips this instrumentation during FastBoot server rendering. To disable automatic Ember performance instrumentation, omit the instance initializer.
To capture timings for a route's beforeModel, model, afterModel, and setupController hooks, wrap its default export with instrumentRoutePerformance().
app/routes/my-route.tsimport Route from "@ember/routing/route";
import { instrumentRoutePerformance } from "@sentry/ember";
class MyRoute extends Route {
model() {
// Load your model here.
}
}
export default instrumentRoutePerformance(MyRoute);
import Route from "@ember/routing/route";
import { instrumentRoutePerformance } from "@sentry/ember";
class MyRoute extends Route {
model() {
// Load your model here.
}
}
export default instrumentRoutePerformance(MyRoute);
After you call instrumentAppInstancePerformance(), the SDK captures classic component render timings by default. Set minimumComponentRenderDuration in the initializer's options to change the minimum duration in milliseconds. The default is 2; set it to 0 to capture all classic component render timings.
Set disableInstrumentComponents: true in the same options object to disable component instrumentation.
After you call instrumentAppInstancePerformance(), the SDK instruments queues in your application's runloop by default. Set minimumRunloopQueueDuration in the initializer's options to change the minimum duration in milliseconds. The default is 5; set it to 0 to capture all runloop queue durations.
Set disableRunloopPerformance: true in the same options object to disable runloop instrumentation.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").