index.js 931 B

123456789101112131415161718192021222324252627
  1. import { lazyLoadedNodePerformanceMonitoringIntegrations } from '@sentry-internal/tracing';
  2. import { logger } from '@sentry/utils';
  3. /**
  4. * Automatically detects and returns integrations that will work with your dependencies.
  5. */
  6. function autoDiscoverNodePerformanceMonitoringIntegrations() {
  7. const loadedIntegrations = lazyLoadedNodePerformanceMonitoringIntegrations
  8. .map(tryLoad => {
  9. try {
  10. return tryLoad();
  11. } catch (_) {
  12. return undefined;
  13. }
  14. })
  15. .filter(integration => !!integration) ;
  16. if (loadedIntegrations.length === 0) {
  17. logger.warn('Performance monitoring integrations could not be automatically loaded.');
  18. }
  19. // Only return integrations where their dependencies loaded successfully.
  20. return loadedIntegrations.filter(integration => !!integration.loadDependency());
  21. }
  22. export { autoDiscoverNodePerformanceMonitoringIntegrations };
  23. //# sourceMappingURL=index.js.map