utils.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { extractTraceparentData as extractTraceparentData$1 } from '@sentry/utils';
  2. export { stripUrlQueryAndFragment } from '@sentry/utils';
  3. import { getCurrentHub } from '../hub.js';
  4. /**
  5. * Grabs active transaction off scope.
  6. *
  7. * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
  8. */
  9. function getActiveTransaction(maybeHub) {
  10. // eslint-disable-next-line deprecation/deprecation
  11. const hub = maybeHub || getCurrentHub();
  12. // eslint-disable-next-line deprecation/deprecation
  13. const scope = hub.getScope();
  14. // eslint-disable-next-line deprecation/deprecation
  15. return scope.getTransaction() ;
  16. }
  17. /**
  18. * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used
  19. * to be declared in this file. It was later moved into `@sentry/utils` as part of a
  20. * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`
  21. * is the only tracing function used by `@sentry/node`).
  22. *
  23. * These exports are kept here for backwards compatability's sake.
  24. *
  25. * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.
  26. *
  27. * @deprecated Import this function from `@sentry/utils` instead
  28. */
  29. const extractTraceparentData = extractTraceparentData$1;
  30. export { extractTraceparentData, getActiveTransaction };
  31. //# sourceMappingURL=utils.js.map