@echoteam/signoz-react 1.0.6 → 1.0.7-beta.0

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
@@ -15283,13 +15283,17 @@ function getConfigValue(key) {
15283
15283
  }
15284
15284
  // Fungsi untuk memvalidasi konfigurasi
15285
15285
  function validateConfig(config) {
15286
- const requiredFields = ['serviceName', 'serviceVersion', 'environment', 'serviceNamespace', 'url'];
15286
+ const requiredFields = ['serviceName', 'serviceVersion', 'environment', 'serviceNamespace', 'url', 'allowedOrigins'];
15287
15287
  const missingFields = [];
15288
15288
  for (const field of requiredFields) {
15289
15289
  if (!config[field]) {
15290
15290
  missingFields.push(field);
15291
15291
  }
15292
15292
  }
15293
+ // Khusus validasi allowedOrigins: pastikan array tidak kosong
15294
+ if (config.allowedOrigins && config.allowedOrigins.length === 0) {
15295
+ missingFields.push('allowedOrigins tidak boleh kosong demi keamanan CORS');
15296
+ }
15293
15297
  return {
15294
15298
  isValid: missingFields.length === 0,
15295
15299
  missingFields
@@ -15384,10 +15388,22 @@ function initializeSignOzTracing(config) {
15384
15388
  }),
15385
15389
  ],
15386
15390
  });
15387
- console.log('SignOz tracing berhasil diinisialisasi');
15391
+ console.log('SignOz: Konfigurasi tracing:', {
15392
+ serviceName: effectiveConfig.serviceName,
15393
+ environment: effectiveConfig.environment,
15394
+ allowedOrigins: effectiveConfig.allowedOrigins,
15395
+ traceSampleRate: effectiveConfig.traceSampleRate
15396
+ });
15397
+ console.log('SignOz: Tracing berhasil diinisialisasi');
15388
15398
  }
15389
- catch (error) {
15399
+ catch (e) {
15400
+ const error = e;
15390
15401
  console.error('SignOz: Gagal menginisialisasi tracing:', error);
15402
+ console.error('SignOz: Detail error:', {
15403
+ name: error.name,
15404
+ message: error.message,
15405
+ stack: error.stack
15406
+ });
15391
15407
  }
15392
15408
  }
15393
15409