hasTracingEnabled.js 796 B

12345678910111213141516171819202122232425
  1. Object.defineProperty(exports, '__esModule', { value: true });
  2. const exports$1 = require('../exports.js');
  3. // Treeshakable guard to remove all code related to tracing
  4. /**
  5. * Determines if tracing is currently enabled.
  6. *
  7. * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.
  8. */
  9. function hasTracingEnabled(
  10. maybeOptions,
  11. ) {
  12. if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {
  13. return false;
  14. }
  15. const client = exports$1.getClient();
  16. const options = maybeOptions || (client && client.getOptions());
  17. return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);
  18. }
  19. exports.hasTracingEnabled = hasTracingEnabled;
  20. //# sourceMappingURL=hasTracingEnabled.js.map