@echoteam/signoz-react 1.2.4 → 1.2.5

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
@@ -15652,6 +15652,7 @@ function addWebSocketLogging(config) {
15652
15652
  if (typeof data === 'string') {
15653
15653
  const truncatedData = truncateBody(data, config.maxBodyLogSize);
15654
15654
  messageSpan.setAttribute('websocket.message', truncatedData);
15655
+ messageSpan.setAttribute('http.request.body', truncatedData); // Add for consistency with HTTP requests
15655
15656
  // Try to parse JSON and extract message if exists
15656
15657
  try {
15657
15658
  const jsonData = JSON.parse(data);
@@ -15669,6 +15670,16 @@ function addWebSocketLogging(config) {
15669
15670
  console.log(`[SignOz] WebSocket Send to ${wsUrl} from page ${pagePath}:`, truncatedData);
15670
15671
  }
15671
15672
  }
15673
+ else if (typeof data === 'number' || typeof data === 'boolean') {
15674
+ // Handle primitive types
15675
+ const dataStr = String(data);
15676
+ messageSpan.setAttribute('websocket.message', dataStr);
15677
+ messageSpan.setAttribute('http.request.body', dataStr);
15678
+ messageSpan.setAttribute('websocket.message.type', typeof data);
15679
+ if (config.enableConsoleLog) {
15680
+ console.log(`[SignOz] WebSocket Send to ${wsUrl} from page ${pagePath}:`, dataStr);
15681
+ }
15682
+ }
15672
15683
  else {
15673
15684
  messageSpan.setAttribute('websocket.message', '[Binary Data]');
15674
15685
  messageSpan.setAttribute('websocket.message.type', 'binary');
@@ -15715,6 +15726,16 @@ function addWebSocketLogging(config) {
15715
15726
  console.log(`[SignOz] WebSocket Receive from ${wsUrl} on page ${pagePath}:`, truncatedData);
15716
15727
  }
15717
15728
  }
15729
+ else if (typeof event.data === 'number' || typeof event.data === 'boolean') {
15730
+ // Handle primitive types
15731
+ const dataStr = String(event.data);
15732
+ messageSpan.setAttribute('websocket.message', dataStr);
15733
+ messageSpan.setAttribute('response.data', dataStr);
15734
+ messageSpan.setAttribute('websocket.message.type', typeof event.data);
15735
+ if (config.enableConsoleLog) {
15736
+ console.log(`[SignOz] WebSocket Receive from ${wsUrl} on page ${pagePath}:`, dataStr);
15737
+ }
15738
+ }
15718
15739
  else {
15719
15740
  messageSpan.setAttribute('websocket.message', '[Binary Data]');
15720
15741
  messageSpan.setAttribute('websocket.message.type', 'binary');