getCurrentSentryReactRootSpan.tsx 249 B

123456789
  1. import * as Sentry from '@sentry/react';
  2. /**
  3. * Gets the current root span, if one exists.
  4. */
  5. export default function getCurrentSentryReactRootSpan() {
  6. const span = Sentry.getActiveSpan();
  7. return span ? Sentry.getRootSpan(span) : undefined;
  8. }