@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.esm.js
CHANGED
|
@@ -15642,6 +15642,20 @@ function addWebSocketLogging(config) {
|
|
|
15642
15642
|
const originalSend = ws.send;
|
|
15643
15643
|
ws.send = function (data) {
|
|
15644
15644
|
if (config.logWebSocketMessages) {
|
|
15645
|
+
// Skip logging if data is just a number
|
|
15646
|
+
let shouldLog = true;
|
|
15647
|
+
if (typeof data === 'string') {
|
|
15648
|
+
// Check if string is just a number
|
|
15649
|
+
if (/^\d+$/.test(data.trim())) {
|
|
15650
|
+
shouldLog = false;
|
|
15651
|
+
}
|
|
15652
|
+
}
|
|
15653
|
+
else if (typeof data === 'number') {
|
|
15654
|
+
shouldLog = false;
|
|
15655
|
+
}
|
|
15656
|
+
if (!shouldLog) {
|
|
15657
|
+
return originalSend.call(ws, data);
|
|
15658
|
+
}
|
|
15645
15659
|
const messageSpan = tracer.startSpan('WebSocket Send');
|
|
15646
15660
|
const sendStartTime = performance.now();
|
|
15647
15661
|
messageSpan.setAttribute('websocket.url', wsUrl);
|
|
@@ -15698,6 +15712,23 @@ function addWebSocketLogging(config) {
|
|
|
15698
15712
|
const originalOnMessage = ws.onmessage;
|
|
15699
15713
|
ws.addEventListener('message', function (event) {
|
|
15700
15714
|
if (config.logWebSocketMessages) {
|
|
15715
|
+
// Skip logging if data is just a number
|
|
15716
|
+
let shouldLog = true;
|
|
15717
|
+
if (typeof event.data === 'string') {
|
|
15718
|
+
// Check if string is just a number
|
|
15719
|
+
if (/^\d+$/.test(event.data.trim())) {
|
|
15720
|
+
shouldLog = false;
|
|
15721
|
+
}
|
|
15722
|
+
}
|
|
15723
|
+
else if (typeof event.data === 'number') {
|
|
15724
|
+
shouldLog = false;
|
|
15725
|
+
}
|
|
15726
|
+
if (!shouldLog) {
|
|
15727
|
+
if (originalOnMessage) {
|
|
15728
|
+
originalOnMessage.call(ws, event);
|
|
15729
|
+
}
|
|
15730
|
+
return;
|
|
15731
|
+
}
|
|
15701
15732
|
const messageSpan = tracer.startSpan('WebSocket Receive');
|
|
15702
15733
|
messageSpan.setAttribute('websocket.url', wsUrl);
|
|
15703
15734
|
messageSpan.setAttribute('websocket.direction', 'receive');
|