@echoteam/signoz-react 1.2.10 → 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.esm.js CHANGED
@@ -15586,9 +15586,15 @@ function addErrorTracking(enableConsoleLog = false) {
15586
15586
  window.addEventListener('unhandledrejection', (event) => {
15587
15587
  // Suppress BatchSpanProcessor timeout errors to avoid noise
15588
15588
  const reason = String(event.reason);
15589
- if (reason.includes('Timeout') && reason.includes('BatchSpanProcessor')) {
15589
+ const stack = event.reason instanceof Error ? (event.reason.stack || '') : '';
15590
+ // Check if this is a SignOz internal timeout error
15591
+ const isSignOzTimeout = (reason.includes('Timeout') &&
15592
+ (reason.includes('BatchSpanProcessor') ||
15593
+ stack.includes('BatchSpanProcessor') ||
15594
+ stack.includes('zone.js')));
15595
+ if (isSignOzTimeout) {
15590
15596
  if (enableConsoleLog) {
15591
- console.warn('[SignOz] Span export timeout (this is usually safe to ignore):', event.reason);
15597
+ console.warn('[SignOz] Span export timeout (this is usually safe to ignore - check if SignOz endpoint is reachable)');
15592
15598
  }
15593
15599
  event.preventDefault(); // Prevent the error from being logged
15594
15600
  return;
@@ -15620,6 +15626,17 @@ function addErrorTracking(enableConsoleLog = false) {
15620
15626
  const originalHandleError = currentZone.handleError;
15621
15627
  if (originalHandleError) {
15622
15628
  currentZone.handleError = function (error) {
15629
+ // Skip SignOz internal timeout errors
15630
+ const errorMessage = error.message || String(error);
15631
+ const errorStack = error.stack || '';
15632
+ const isSignOzTimeout = (errorMessage.includes('Timeout') &&
15633
+ (errorStack.includes('BatchSpanProcessor') || errorStack.includes('zone.js')));
15634
+ if (isSignOzTimeout) {
15635
+ if (enableConsoleLog) {
15636
+ console.warn('[SignOz] Zone.js caught span export timeout (safe to ignore)');
15637
+ }
15638
+ return; // Don't track this error
15639
+ }
15623
15640
  const tracer = trace.getTracer('error-tracker');
15624
15641
  const span = tracer.startSpan('Zone.js Error');
15625
15642
  span.setAttribute('error.type', 'zone_error');