How to use @sentry/apm - 1 common examples

To help you get started, we’ve selected a few @sentry/apm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getsentry / sentry / src / sentry / static / sentry / app / bootstrap.jsx View on Github external
if (window.__initialData) {
  ConfigStore.loadInitialData(window.__initialData);
}

// SDK INIT  --------------------------------------------------------
const config = ConfigStore.getConfig();
// Only enable self-tracing when isApmDataSamplingEnabled is true
const tracesSampleRate = config ? config.apmSampling : 0;
Sentry.init({
  ...window.__SENTRY__OPTIONS,
  integrations: [
    new ExtraErrorData({
      // 6 is arbitrary, seems like a nice number
      depth: 6,
    }),
    new Integrations.Tracing({
      tracingOrigins: ['localhost', 'sentry.io', /^\//],
      tracesSampleRate,
    }),
  ],
});

if (window.__SENTRY__USER) {
  Sentry.setUser(window.__SENTRY__USER);
}
if (window.__SENTRY__VERSION) {
  Sentry.setTag('sentry_version', window.__SENTRY__VERSION);
}

// Used for operational metrics to determine that the application js
// bundle was loaded by browser.
metric.mark('sentry-app-init');

@sentry/apm

Extensions for APM

MIT
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis

Popular @sentry/apm functions