@nxtedition/lib 23.17.5 → 23.17.7
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/app.js +1 -1
- package/package.json +1 -1
- package/trace.js +4 -3
package/app.js
CHANGED
|
@@ -414,7 +414,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
414
414
|
dsConfig.credentials.username ||
|
|
415
415
|
dsConfig.credentials.userName ||
|
|
416
416
|
dsConfig.credentials.user ||
|
|
417
|
-
`_${serviceName}`
|
|
417
|
+
`_${serviceName}/${serviceModule}/${serviceInstanceId}/${serviceWorkerId}`
|
|
418
418
|
|
|
419
419
|
dsConfig = {
|
|
420
420
|
maxReconnectAttempts: Infinity,
|
package/package.json
CHANGED
package/trace.js
CHANGED
|
@@ -73,7 +73,7 @@ export function makeTrace({
|
|
|
73
73
|
dropCount = 0
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const header = `{"create":{"_index":"trace-${index}"}}\n`
|
|
77
77
|
const postfix = `","serviceName":"${serviceName}","pid":${process.pid},"tid":${threadId}}\n`
|
|
78
78
|
|
|
79
79
|
function trace(obj, op) {
|
|
@@ -81,8 +81,9 @@ export function makeTrace({
|
|
|
81
81
|
dropCount++
|
|
82
82
|
warnDrop()
|
|
83
83
|
} else {
|
|
84
|
-
const doc = (typeof obj === 'string' ? obj : stringify(obj)).slice(
|
|
85
|
-
traceData +=
|
|
84
|
+
const doc = (typeof obj === 'string' ? obj : stringify(obj)).slice(0, -1)
|
|
85
|
+
traceData += header
|
|
86
|
+
traceData += `${doc},"traceId":${genTraceId()},"@timestamp":${Date.now()},"op":"${op}${postfix}`
|
|
86
87
|
if (traceData.length > batch) {
|
|
87
88
|
flushTraces()
|
|
88
89
|
}
|