@echoteam/signoz-react 1.2.8 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -15604,6 +15604,21 @@ function addErrorTracking(enableConsoleLog = false) {
15604
15604
  }, true); // Use capture phase to catch errors early
15605
15605
  // Track unhandled promise rejections
15606
15606
  window.addEventListener('unhandledrejection', (event) => {
15607
+ // Suppress BatchSpanProcessor timeout errors to avoid noise
15608
+ const reason = String(event.reason);
15609
+ const stack = event.reason instanceof Error ? (event.reason.stack || '') : '';
15610
+ // Check if this is a SignOz internal timeout error
15611
+ const isSignOzTimeout = (reason.includes('Timeout') &&
15612
+ (reason.includes('BatchSpanProcessor') ||
15613
+ stack.includes('BatchSpanProcessor') ||
15614
+ stack.includes('zone.js')));
15615
+ if (isSignOzTimeout) {
15616
+ if (enableConsoleLog) {
15617
+ console.warn('[SignOz] Span export timeout (this is usually safe to ignore - check if SignOz endpoint is reachable)');
15618
+ }
15619
+ event.preventDefault(); // Prevent the error from being logged
15620
+ return;
15621
+ }
15607
15622
  const tracer = trace.getTracer('error-tracker');
15608
15623
  const span = tracer.startSpan('Unhandled Promise Rejection');
15609
15624
  span.setAttribute('error.type', 'unhandled_rejection');
@@ -15631,6 +15646,17 @@ function addErrorTracking(enableConsoleLog = false) {
15631
15646
  const originalHandleError = currentZone.handleError;
15632
15647
  if (originalHandleError) {
15633
15648
  currentZone.handleError = function (error) {
15649
+ // Skip SignOz internal timeout errors
15650
+ const errorMessage = error.message || String(error);
15651
+ const errorStack = error.stack || '';
15652
+ const isSignOzTimeout = (errorMessage.includes('Timeout') &&
15653
+ (errorStack.includes('BatchSpanProcessor') || errorStack.includes('zone.js')));
15654
+ if (isSignOzTimeout) {
15655
+ if (enableConsoleLog) {
15656
+ console.warn('[SignOz] Zone.js caught span export timeout (safe to ignore)');
15657
+ }
15658
+ return; // Don't track this error
15659
+ }
15634
15660
  const tracer = trace.getTracer('error-tracker');
15635
15661
  const span = tracer.startSpan('Zone.js Error');
15636
15662
  span.setAttribute('error.type', 'zone_error');
@@ -16004,7 +16030,8 @@ function initializeSignOzTracing(config) {
16004
16030
  batchSpanProcessorConfig: (config === null || config === void 0 ? void 0 : config.batchSpanProcessorConfig) || {
16005
16031
  maxQueueSize: 100,
16006
16032
  scheduledDelayMillis: 5000,
16007
- exportTimeoutMillis: 30000
16033
+ exportTimeoutMillis: 60000, // Increased to 60 seconds
16034
+ maxExportBatchSize: 50 // Smaller batches to avoid timeouts
16008
16035
  },
16009
16036
  allowedOrigins: (config === null || config === void 0 ? void 0 : config.allowedOrigins) || parseAllowedOrigins(getConfigValue('REACT_APP_SIGNOZ_ALLOWED_ORIGINS')),
16010
16037
  enableRequestLogging: (config === null || config === void 0 ? void 0 : config.enableRequestLogging) !== undefined ? config.enableRequestLogging : (getConfigValue('REACT_APP_SIGNOZ_ENABLE_REQUEST_LOGGING') === 'true' || true),
@@ -16035,7 +16062,8 @@ function initializeSignOzTracing(config) {
16035
16062
  // Set up the OTLP trace exporter
16036
16063
  const exporter = new OTLPTraceExporter({
16037
16064
  url: effectiveConfig.url,
16038
- headers: effectiveConfig.headers
16065
+ headers: effectiveConfig.headers,
16066
+ timeoutMillis: 60000 // Set exporter timeout to 60 seconds
16039
16067
  });
16040
16068
  // Set up the span processor with configuration
16041
16069
  const processor = new BatchSpanProcessor(exporter, {