@zintrust/trace 1.6.3 → 1.6.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/build-manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/trace",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"buildDate": "2026-04-
|
|
3
|
+
"version": "1.6.4",
|
|
4
|
+
"buildDate": "2026-04-30T15:30:37.643Z",
|
|
5
5
|
"buildEnvironment": {
|
|
6
|
-
"node": "
|
|
6
|
+
"node": "v25.6.1",
|
|
7
7
|
"platform": "darwin",
|
|
8
8
|
"arch": "arm64"
|
|
9
9
|
},
|
|
10
10
|
"git": {
|
|
11
|
-
"commit": "
|
|
11
|
+
"commit": "f235df8b",
|
|
12
12
|
"branch": "release"
|
|
13
13
|
},
|
|
14
14
|
"package": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"build-manifest.json": {
|
|
33
33
|
"size": 15912,
|
|
34
|
-
"sha256": "
|
|
34
|
+
"sha256": "6732e16044ffbcb77bf9873cf30a671007b5acc4aa2f3edf5071da667d4df534"
|
|
35
35
|
},
|
|
36
36
|
"cli-register.d.ts": {
|
|
37
37
|
"size": 255,
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"index.js": {
|
|
89
89
|
"size": 3421,
|
|
90
|
-
"sha256": "
|
|
90
|
+
"sha256": "ee5aca20d1e6d980fa0b2c02e4832c35e8a18fff9fe63a7bf6a26ae8f734d377"
|
|
91
91
|
},
|
|
92
92
|
"ingest/TraceIngestGateway.d.ts": {
|
|
93
93
|
"size": 786,
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
"sha256": "535869aa1bfcdf0ec26fad27d7f18bb8822bc586c38fcc5ffdde5274ecbea17e"
|
|
151
151
|
},
|
|
152
152
|
"register.js": {
|
|
153
|
-
"size":
|
|
154
|
-
"sha256": "
|
|
153
|
+
"size": 19680,
|
|
154
|
+
"sha256": "042a7585e68a8a676e25f33c9a176c6f263bccb4a63090b4d2cea52b9bcdd193"
|
|
155
155
|
},
|
|
156
156
|
"storage/DebuggerStorage.d.ts": {
|
|
157
157
|
"size": 517,
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
"sha256": "606a37af0a4aef4866c22cc727f67f485c43181b40eb831e1920b8b90fdaf503"
|
|
175
175
|
},
|
|
176
176
|
"storage/TraceContentBudget.js": {
|
|
177
|
-
"size":
|
|
178
|
-
"sha256": "
|
|
177
|
+
"size": 11495,
|
|
178
|
+
"sha256": "8ed670773814f7b86b916c43ac43b048defc6a102593d808dfb4c8cf7606edf3"
|
|
179
179
|
},
|
|
180
180
|
"storage/TraceContentRedaction.d.ts": {
|
|
181
181
|
"size": 207,
|
|
@@ -190,8 +190,8 @@
|
|
|
190
190
|
"sha256": "a1158cedb4e4e749658127086e138e47886422366a697619d6ea9bd3338066e6"
|
|
191
191
|
},
|
|
192
192
|
"storage/TraceEntryFiltering.js": {
|
|
193
|
-
"size":
|
|
194
|
-
"sha256": "
|
|
193
|
+
"size": 1579,
|
|
194
|
+
"sha256": "a096b0fadf21cd692e554e6ca7789f08759cffe1c690845cb33c5876c8587cc5"
|
|
195
195
|
},
|
|
196
196
|
"storage/TraceServiceTag.d.ts": {
|
|
197
197
|
"size": 224,
|
|
@@ -422,8 +422,8 @@
|
|
|
422
422
|
"sha256": "5d5046c65e5b683369c7709f1acd09b60aec3e7f44748fd1baeb35498836465b"
|
|
423
423
|
},
|
|
424
424
|
"watchers/QueryWatcher.js": {
|
|
425
|
-
"size":
|
|
426
|
-
"sha256": "
|
|
425
|
+
"size": 2855,
|
|
426
|
+
"sha256": "dcb9fe2049e71b5fc850286758737d80738a07dd470d96f36e418d4f54e16263"
|
|
427
427
|
},
|
|
428
428
|
"watchers/RedisWatcher.d.ts": {
|
|
429
429
|
"size": 294,
|
|
@@ -162,6 +162,7 @@ const hasQueueDispatch = (config) => {
|
|
|
162
162
|
const driver = config.contentDispatch.driver?.trim();
|
|
163
163
|
return typeof driver === 'string' && driver !== '';
|
|
164
164
|
};
|
|
165
|
+
const WORKERS_PACKAGE_SPECIFIER = '@zintrust/workers';
|
|
165
166
|
const getCoreRuntime = async () => {
|
|
166
167
|
try {
|
|
167
168
|
const mod = (await import('@zintrust/core'));
|
|
@@ -180,7 +181,7 @@ const getCoreRuntime = async () => {
|
|
|
180
181
|
const getQueueWorkerApi = async () => {
|
|
181
182
|
try {
|
|
182
183
|
// @ts-ignore
|
|
183
|
-
const mod = (await import(
|
|
184
|
+
const mod = (await import(WORKERS_PACKAGE_SPECIFIER));
|
|
184
185
|
return typeof mod.createQueueWorker === 'function' ? mod : null;
|
|
185
186
|
}
|
|
186
187
|
catch {
|
|
@@ -2,7 +2,6 @@ import { TraceContext } from '../context.js';
|
|
|
2
2
|
import { EntryType } from '../types.js';
|
|
3
3
|
import { TraceEntryFilter } from '../utils/entryFilter.js';
|
|
4
4
|
import { RequestFilter } from '../utils/requestFilter.js';
|
|
5
|
-
const MAX_IGNORED_BATCHES = 512;
|
|
6
5
|
const isObjectValue = (value) => {
|
|
7
6
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
7
|
};
|
|
@@ -13,51 +12,27 @@ const getEntryUri = (entry) => {
|
|
|
13
12
|
const uri = content?.['uri'];
|
|
14
13
|
return typeof uri === 'string' && uri.trim() !== '' ? uri : undefined;
|
|
15
14
|
};
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const remember = (batchId) => {
|
|
20
|
-
if (ignoredBatchIds.has(batchId))
|
|
21
|
-
return;
|
|
22
|
-
ignoredBatchIds.add(batchId);
|
|
23
|
-
ignoredBatchOrder.push(batchId);
|
|
24
|
-
if (ignoredBatchOrder.length <= MAX_IGNORED_BATCHES)
|
|
25
|
-
return;
|
|
26
|
-
const evictedBatchId = ignoredBatchOrder.shift();
|
|
27
|
-
if (evictedBatchId !== undefined) {
|
|
28
|
-
ignoredBatchIds.delete(evictedBatchId);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const has = (batchId) => {
|
|
32
|
-
return ignoredBatchIds.has(batchId);
|
|
33
|
-
};
|
|
34
|
-
return Object.freeze({ has, remember });
|
|
35
|
-
};
|
|
36
|
-
const shouldDropForIgnoredRequest = (entry, config, tracker) => {
|
|
37
|
-
if (tracker.has(entry.batchId)) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
15
|
+
const shouldDropForIgnoredRequest = (entry, config) => {
|
|
16
|
+
if (entry.type !== EntryType.REQUEST)
|
|
17
|
+
return false;
|
|
40
18
|
const currentPath = TraceContext.getRequestPath();
|
|
41
19
|
if (typeof currentPath === 'string' &&
|
|
42
20
|
currentPath !== '' &&
|
|
43
21
|
RequestFilter.matchesIgnoredPath(currentPath, config)) {
|
|
44
|
-
tracker.remember(entry.batchId);
|
|
45
22
|
return true;
|
|
46
23
|
}
|
|
47
24
|
const uri = getEntryUri(entry);
|
|
48
25
|
if (typeof uri === 'string' && RequestFilter.matchesIgnoredPath(uri, config)) {
|
|
49
|
-
tracker.remember(entry.batchId);
|
|
50
26
|
return true;
|
|
51
27
|
}
|
|
52
28
|
return false;
|
|
53
29
|
};
|
|
54
30
|
export const TraceEntryFiltering = Object.freeze({
|
|
55
31
|
wrapStorage(storage, config) {
|
|
56
|
-
const ignoredBatchTracker = createIgnoredBatchTracker();
|
|
57
32
|
return Object.freeze({
|
|
58
33
|
...storage,
|
|
59
34
|
async writeEntry(entry) {
|
|
60
|
-
if (shouldDropForIgnoredRequest(entry, config
|
|
35
|
+
if (shouldDropForIgnoredRequest(entry, config))
|
|
61
36
|
return;
|
|
62
37
|
if (!TraceEntryFilter.shouldCapture(entry, config))
|
|
63
38
|
return;
|
|
@@ -5,7 +5,6 @@ import { TraceContext } from '../context.js';
|
|
|
5
5
|
import { TraceStorage } from '../storage/index.js';
|
|
6
6
|
import { EntryType } from '../types.js';
|
|
7
7
|
import { AuthTag } from '../utils/authTag.js';
|
|
8
|
-
import { RequestFilter } from '../utils/requestFilter.js';
|
|
9
8
|
let _storage = null;
|
|
10
9
|
let _config = null;
|
|
11
10
|
const bindingsInterpolated = (sql, params) => {
|
|
@@ -29,8 +28,6 @@ const isTraceStorageQuery = (sql) => {
|
|
|
29
28
|
const emit = (query, params, duration, connection = 'default') => {
|
|
30
29
|
if (_storage === null || _config === null)
|
|
31
30
|
return;
|
|
32
|
-
if (RequestFilter.shouldIgnoreCurrentRequest(_config.ignoreRoutes, _config.ignorePaths))
|
|
33
|
-
return;
|
|
34
31
|
if (isTraceStorageQuery(query))
|
|
35
32
|
return;
|
|
36
33
|
const batchId = TraceContext.getBatchId();
|