@echoteam/signoz-react 1.2.14 → 1.2.15

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
@@ -16140,7 +16140,8 @@ function initializeSignOzTracing(config) {
16140
16140
  window.onerror = function (message, source, lineno, colno, error) {
16141
16141
  const errorMessage = String(message);
16142
16142
  const errorStack = (error === null || error === void 0 ? void 0 : error.stack) || '';
16143
- // Suppress SignOz timeout errors globally
16143
+ const errorSource = source || '';
16144
+ // Suppress SignOz timeout errors globally - be very aggressive
16144
16145
  const isSignOzTimeout = ((errorMessage.includes('Timeout') || errorMessage.includes('timeout') || errorMessage.includes('ETIMEDOUT')) &&
16145
16146
  (errorMessage.includes('BatchSpanProcessor') ||
16146
16147
  errorMessage.includes('OTLP') ||
@@ -16148,10 +16149,12 @@ function initializeSignOzTracing(config) {
16148
16149
  errorStack.includes('BatchSpanProcessor') ||
16149
16150
  errorStack.includes('OTLPTraceExporter') ||
16150
16151
  errorStack.includes('zone.js') ||
16151
- (source === null || source === void 0 ? void 0 : source.includes('zone.js'))));
16152
- const isGenericTimeout = (errorMessage === 'Timeout' ||
16153
- errorMessage === 'timeout' ||
16154
- (errorMessage.includes('Timeout') && errorStack.includes('zone.js')));
16152
+ errorSource.includes('zone.js') ||
16153
+ errorStack.includes('signoz') ||
16154
+ errorSource.includes('signoz')));
16155
+ // Also suppress generic timeout errors from zone.js or bundle.js
16156
+ const isGenericTimeout = ((errorMessage === 'Timeout' || errorMessage === 'timeout') ||
16157
+ (errorMessage.includes('Timeout') && (errorStack.includes('zone.js') || errorSource.includes('bundle.js'))));
16155
16158
  if (isSignOzTimeout || isGenericTimeout) {
16156
16159
  // Suppress completely - don't log, don't propagate
16157
16160
  return true; // Returning true prevents default error handling
@@ -16162,6 +16165,32 @@ function initializeSignOzTracing(config) {
16162
16165
  }
16163
16166
  return false;
16164
16167
  };
16168
+ // Also suppress unhandledrejection for timeout errors
16169
+ const originalUnhandledRejection = window.onunhandledrejection;
16170
+ window.addEventListener('unhandledrejection', function (event) {
16171
+ const reason = String(event.reason);
16172
+ const stack = event.reason instanceof Error ? (event.reason.stack || '') : '';
16173
+ const isSignOzTimeout = ((reason.includes('Timeout') || reason.includes('timeout') || reason.includes('ETIMEDOUT')) &&
16174
+ (reason.includes('BatchSpanProcessor') ||
16175
+ reason.includes('OTLP') ||
16176
+ reason.includes('exporter') ||
16177
+ stack.includes('BatchSpanProcessor') ||
16178
+ stack.includes('OTLPTraceExporter') ||
16179
+ stack.includes('zone.js') ||
16180
+ stack.includes('signoz')));
16181
+ const isGenericTimeout = (reason === 'Timeout' ||
16182
+ reason === 'timeout' ||
16183
+ (reason.includes('Timeout') && stack.includes('zone.js')));
16184
+ if (isSignOzTimeout || isGenericTimeout) {
16185
+ event.preventDefault();
16186
+ event.stopPropagation();
16187
+ event.stopImmediatePropagation();
16188
+ return;
16189
+ }
16190
+ if (originalUnhandledRejection) {
16191
+ originalUnhandledRejection.call(window, event);
16192
+ }
16193
+ }, true);
16165
16194
  // Gabungkan konfigurasi dari parameter, process.env, dan window
16166
16195
  const effectiveConfig = {
16167
16196
  serviceName: (config === null || config === void 0 ? void 0 : config.serviceName) || getConfigValue('REACT_APP_SIGNOZ_SERVICE_NAME'),
@@ -16176,9 +16205,9 @@ function initializeSignOzTracing(config) {
16176
16205
  })(),
16177
16206
  batchSpanProcessorConfig: (config === null || config === void 0 ? void 0 : config.batchSpanProcessorConfig) || {
16178
16207
  maxQueueSize: 100,
16179
- scheduledDelayMillis: 3000, // Kirim lebih cepat (3 detik)
16180
- exportTimeoutMillis: 10000, // Timeout lebih pendek (10 detik)
16181
- maxExportBatchSize: 30 // Batch lebih kecil untuk menghindari timeout
16208
+ scheduledDelayMillis: 2000, // Kirim lebih cepat (2 detik)
16209
+ exportTimeoutMillis: 5000, // Timeout lebih pendek (5 detik)
16210
+ maxExportBatchSize: 20 // Batch lebih kecil untuk menghindari timeout
16182
16211
  },
16183
16212
  allowedOrigins: (config === null || config === void 0 ? void 0 : config.allowedOrigins) || parseAllowedOrigins(getConfigValue('REACT_APP_SIGNOZ_ALLOWED_ORIGINS')),
16184
16213
  enableRequestLogging: (config === null || config === void 0 ? void 0 : config.enableRequestLogging) !== undefined ? config.enableRequestLogging : (getConfigValue('REACT_APP_SIGNOZ_ENABLE_REQUEST_LOGGING') === 'true' || true),
@@ -16212,14 +16241,20 @@ function initializeSignOzTracing(config) {
16212
16241
  const exporter = new OTLPTraceExporter({
16213
16242
  url: effectiveConfig.url,
16214
16243
  headers: effectiveConfig.headers,
16215
- timeoutMillis: 10000 // Timeout lebih pendek (10 detik)
16244
+ timeoutMillis: 5000 // Timeout lebih pendek (5 detik) untuk fail fast
16216
16245
  });
16217
16246
  // Wrap exporter to suppress timeout errors completely
16218
16247
  const originalExport = exporter.export.bind(exporter);
16219
16248
  exporter.export = function (spans, resultCallback) {
16220
16249
  // Wrap in try-catch to prevent any errors from propagating
16221
16250
  try {
16251
+ // Set a timeout to force success callback if export takes too long
16252
+ const timeoutId = setTimeout(() => {
16253
+ // Force success callback to prevent error propagation
16254
+ resultCallback({ code: 0 });
16255
+ }, 6000); // Slightly longer than exporter timeout
16222
16256
  originalExport(spans, (result) => {
16257
+ clearTimeout(timeoutId);
16223
16258
  // Suppress ALL errors to prevent console noise and Zone.js catching them
16224
16259
  if (result.error) {
16225
16260
  const errorMessage = String(result.error);