@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.js CHANGED
@@ -15672,6 +15672,7 @@ function addWebSocketLogging(config) {
15672
15672
  if (typeof data === 'string') {
15673
15673
  const truncatedData = truncateBody(data, config.maxBodyLogSize);
15674
15674
  messageSpan.setAttribute('websocket.message', truncatedData);
15675
+ messageSpan.setAttribute('http.request.body', truncatedData); // Add for consistency with HTTP requests
15675
15676
  // Try to parse JSON and extract message if exists
15676
15677
  try {
15677
15678
  const jsonData = JSON.parse(data);
@@ -15689,6 +15690,16 @@ function addWebSocketLogging(config) {
15689
15690
  console.log(`[SignOz] WebSocket Send to ${wsUrl} from page ${pagePath}:`, truncatedData);
15690
15691
  }
15691
15692
  }
15693
+ else if (typeof data === 'number' || typeof data === 'boolean') {
15694
+ // Handle primitive types
15695
+ const dataStr = String(data);
15696
+ messageSpan.setAttribute('websocket.message', dataStr);
15697
+ messageSpan.setAttribute('http.request.body', dataStr);
15698
+ messageSpan.setAttribute('websocket.message.type', typeof data);
15699
+ if (config.enableConsoleLog) {
15700
+ console.log(`[SignOz] WebSocket Send to ${wsUrl} from page ${pagePath}:`, dataStr);
15701
+ }
15702
+ }
15692
15703
  else {
15693
15704
  messageSpan.setAttribute('websocket.message', '[Binary Data]');
15694
15705
  messageSpan.setAttribute('websocket.message.type', 'binary');
@@ -15735,6 +15746,16 @@ function addWebSocketLogging(config) {
15735
15746
  console.log(`[SignOz] WebSocket Receive from ${wsUrl} on page ${pagePath}:`, truncatedData);
15736
15747
  }
15737
15748
  }
15749
+ else if (typeof event.data === 'number' || typeof event.data === 'boolean') {
15750
+ // Handle primitive types
15751
+ const dataStr = String(event.data);
15752
+ messageSpan.setAttribute('websocket.message', dataStr);
15753
+ messageSpan.setAttribute('response.data', dataStr);
15754
+ messageSpan.setAttribute('websocket.message.type', typeof event.data);
15755
+ if (config.enableConsoleLog) {
15756
+ console.log(`[SignOz] WebSocket Receive from ${wsUrl} on page ${pagePath}:`, dataStr);
15757
+ }
15758
+ }
15738
15759
  else {
15739
15760
  messageSpan.setAttribute('websocket.message', '[Binary Data]');
15740
15761
  messageSpan.setAttribute('websocket.message.type', 'binary');