@echoteam/signoz-react 1.2.5 → 1.2.6
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 +31 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15662,6 +15662,20 @@ function addWebSocketLogging(config) {
|
|
|
15662
15662
|
const originalSend = ws.send;
|
|
15663
15663
|
ws.send = function (data) {
|
|
15664
15664
|
if (config.logWebSocketMessages) {
|
|
15665
|
+
// Skip logging if data is just a number
|
|
15666
|
+
let shouldLog = true;
|
|
15667
|
+
if (typeof data === 'string') {
|
|
15668
|
+
// Check if string is just a number
|
|
15669
|
+
if (/^\d+$/.test(data.trim())) {
|
|
15670
|
+
shouldLog = false;
|
|
15671
|
+
}
|
|
15672
|
+
}
|
|
15673
|
+
else if (typeof data === 'number') {
|
|
15674
|
+
shouldLog = false;
|
|
15675
|
+
}
|
|
15676
|
+
if (!shouldLog) {
|
|
15677
|
+
return originalSend.call(ws, data);
|
|
15678
|
+
}
|
|
15665
15679
|
const messageSpan = tracer.startSpan('WebSocket Send');
|
|
15666
15680
|
const sendStartTime = performance.now();
|
|
15667
15681
|
messageSpan.setAttribute('websocket.url', wsUrl);
|
|
@@ -15718,6 +15732,23 @@ function addWebSocketLogging(config) {
|
|
|
15718
15732
|
const originalOnMessage = ws.onmessage;
|
|
15719
15733
|
ws.addEventListener('message', function (event) {
|
|
15720
15734
|
if (config.logWebSocketMessages) {
|
|
15735
|
+
// Skip logging if data is just a number
|
|
15736
|
+
let shouldLog = true;
|
|
15737
|
+
if (typeof event.data === 'string') {
|
|
15738
|
+
// Check if string is just a number
|
|
15739
|
+
if (/^\d+$/.test(event.data.trim())) {
|
|
15740
|
+
shouldLog = false;
|
|
15741
|
+
}
|
|
15742
|
+
}
|
|
15743
|
+
else if (typeof event.data === 'number') {
|
|
15744
|
+
shouldLog = false;
|
|
15745
|
+
}
|
|
15746
|
+
if (!shouldLog) {
|
|
15747
|
+
if (originalOnMessage) {
|
|
15748
|
+
originalOnMessage.call(ws, event);
|
|
15749
|
+
}
|
|
15750
|
+
return;
|
|
15751
|
+
}
|
|
15721
15752
|
const messageSpan = tracer.startSpan('WebSocket Receive');
|
|
15722
15753
|
messageSpan.setAttribute('websocket.url', wsUrl);
|
|
15723
15754
|
messageSpan.setAttribute('websocket.direction', 'receive');
|