How to use the @sentry/hub.getMainCarrier function in @sentry/hub

To help you get started, we’ve selected a few @sentry/hub 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-javascript / packages / apm / src / hubextensions.ts View on Github external
export function addExtensionMethods(): void {
  const carrier = getMainCarrier();
  if (carrier.__SENTRY__) {
    carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
    if (!carrier.__SENTRY__.extensions.startSpan) {
      carrier.__SENTRY__.extensions.startSpan = startSpan;
    }
    if (!carrier.__SENTRY__.extensions.traceHeaders) {
      carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
    }
  }
}

@sentry/hub

Sentry hub which handles global state managment.

MIT
Latest version published 6 months ago

Package Health Score

93 / 100
Full package analysis