@zintrust/queue-monitor 2.4.3 → 2.4.4
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 +17 -17
- package/dist/driver.d.ts +14 -0
- package/dist/driver.js +21 -3
- package/dist/index.js +11 -2
- package/dist/runtime-index.js +11 -2
- package/package.json +1 -1
package/dist/build-manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/queue-monitor",
|
|
3
|
-
"version": "2.4.
|
|
4
|
-
"buildDate": "2026-
|
|
3
|
+
"version": "2.4.3",
|
|
4
|
+
"buildDate": "2026-06-01T13:35:49.849Z",
|
|
5
5
|
"buildEnvironment": {
|
|
6
6
|
"node": "v22.22.1",
|
|
7
7
|
"platform": "darwin",
|
|
8
8
|
"arch": "arm64"
|
|
9
9
|
},
|
|
10
10
|
"git": {
|
|
11
|
-
"commit": "
|
|
11
|
+
"commit": "98a0caf4",
|
|
12
12
|
"branch": "release"
|
|
13
13
|
},
|
|
14
14
|
"package": {
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"sha256": "33e57f6cec15b8dcb5886ca92644139d2e3ca1789aae1c3a4a066d75a273a6bb"
|
|
35
35
|
},
|
|
36
36
|
"QueueMonitoringService.d.ts": {
|
|
37
|
-
"size":
|
|
38
|
-
"sha256": "
|
|
37
|
+
"size": 1760,
|
|
38
|
+
"sha256": "949569e78120329804b63736b25c8cff9b5516ca44c9e7f1b2989d9cb09360b9"
|
|
39
39
|
},
|
|
40
40
|
"QueueMonitoringService.js": {
|
|
41
|
-
"size":
|
|
42
|
-
"sha256": "
|
|
41
|
+
"size": 10048,
|
|
42
|
+
"sha256": "3b7e85e6a0ba5dd958010bdf023052b1fb66cfbb52047554b326b4465b817719"
|
|
43
43
|
},
|
|
44
44
|
"build-manifest.json": {
|
|
45
|
-
"size":
|
|
46
|
-
"sha256": "
|
|
45
|
+
"size": 3869,
|
|
46
|
+
"sha256": "c1ba9522a69a44edce77119e8fd9df36dff9e8797d8a040448a8659da8b0721c"
|
|
47
47
|
},
|
|
48
48
|
"connection.d.ts": {
|
|
49
49
|
"size": 287,
|
|
@@ -78,20 +78,20 @@
|
|
|
78
78
|
"sha256": "fb91df973acd13a88cca443e50ecdd34944c66e1a1d48333f63099079a00f3c9"
|
|
79
79
|
},
|
|
80
80
|
"driver.d.ts": {
|
|
81
|
-
"size":
|
|
82
|
-
"sha256": "
|
|
81
|
+
"size": 1782,
|
|
82
|
+
"sha256": "a1629f48367efab3c0031ace21c5304821d01ca1d7027cc7a50b62570339c848"
|
|
83
83
|
},
|
|
84
84
|
"driver.js": {
|
|
85
|
-
"size":
|
|
86
|
-
"sha256": "
|
|
85
|
+
"size": 12473,
|
|
86
|
+
"sha256": "162ee0db3fe8a0cbc6378133a22d6df723a900e08ea74817c562b830a88338db"
|
|
87
87
|
},
|
|
88
88
|
"index.d.ts": {
|
|
89
89
|
"size": 2344,
|
|
90
90
|
"sha256": "370b578ca6412fbdbb2f6966c0899a4c9d6d1ab08defe48a9004564124b1f45e"
|
|
91
91
|
},
|
|
92
92
|
"index.js": {
|
|
93
|
-
"size":
|
|
94
|
-
"sha256": "
|
|
93
|
+
"size": 17226,
|
|
94
|
+
"sha256": "79f16f77f5e56c815212ffc43718fee07cf490c4f7fd9ff0e68fa656337b8a76"
|
|
95
95
|
},
|
|
96
96
|
"metrics-index.d.ts": {
|
|
97
97
|
"size": 239,
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
"sha256": "b4608f964f6c5cdb5469eb320683fee827734adcf1d03ea931766405451f35df"
|
|
115
115
|
},
|
|
116
116
|
"runtime-index.js": {
|
|
117
|
-
"size":
|
|
118
|
-
"sha256": "
|
|
117
|
+
"size": 9948,
|
|
118
|
+
"sha256": "7aa5c97aef19ec36e1309b9abc922481924672e4017bc3fe198b5eff7dabda86"
|
|
119
119
|
},
|
|
120
120
|
"worker.d.ts": {
|
|
121
121
|
"size": 338,
|
package/dist/driver.d.ts
CHANGED
|
@@ -2,6 +2,20 @@ import type { Job, JobsOptions } from 'bullmq';
|
|
|
2
2
|
import { type RedisConfig } from './connection.js';
|
|
3
3
|
export type JobPayload<T = unknown> = T;
|
|
4
4
|
export type JobCounts = Record<string, number>;
|
|
5
|
+
/**
|
|
6
|
+
* Standard BullMQ job-count buckets, all zero. Used when the backing store is
|
|
7
|
+
* unavailable so a queue is still listed (with empty counts) instead of being
|
|
8
|
+
* dropped from the snapshot entirely.
|
|
9
|
+
*/
|
|
10
|
+
export declare const emptyCounts: () => JobCounts;
|
|
11
|
+
/**
|
|
12
|
+
* Map a list of known queue names to entries with empty counts. Keeps the
|
|
13
|
+
* dashboard showing the configured queues during transient backend outages.
|
|
14
|
+
*/
|
|
15
|
+
export declare const emptyQueueStats: (queueNames: ReadonlyArray<string>) => Array<{
|
|
16
|
+
name: string;
|
|
17
|
+
counts: JobCounts;
|
|
18
|
+
}>;
|
|
5
19
|
export type RetrySnapshot = {
|
|
6
20
|
name?: string;
|
|
7
21
|
data: unknown;
|
package/dist/driver.js
CHANGED
|
@@ -4,6 +4,24 @@ import { Logger } from '@zintrust/core/logger';
|
|
|
4
4
|
import { getBullMQSafeQueueName } from '@zintrust/core/redis';
|
|
5
5
|
import { Queue } from 'bullmq';
|
|
6
6
|
import { createRedisConnection } from './connection.js';
|
|
7
|
+
/**
|
|
8
|
+
* Standard BullMQ job-count buckets, all zero. Used when the backing store is
|
|
9
|
+
* unavailable so a queue is still listed (with empty counts) instead of being
|
|
10
|
+
* dropped from the snapshot entirely.
|
|
11
|
+
*/
|
|
12
|
+
export const emptyCounts = () => ({
|
|
13
|
+
waiting: 0,
|
|
14
|
+
active: 0,
|
|
15
|
+
completed: 0,
|
|
16
|
+
failed: 0,
|
|
17
|
+
delayed: 0,
|
|
18
|
+
paused: 0,
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Map a list of known queue names to entries with empty counts. Keeps the
|
|
22
|
+
* dashboard showing the configured queues during transient backend outages.
|
|
23
|
+
*/
|
|
24
|
+
export const emptyQueueStats = (queueNames) => queueNames.map((name) => ({ name, counts: emptyCounts() }));
|
|
7
25
|
const shouldUseRedisRpcMonitorDriver = () => Env.USE_REDIS_PROXY === true && Env.get('REDIS_RPC_URL', '').trim() !== '';
|
|
8
26
|
const resolveRpcBaseUrl = () => {
|
|
9
27
|
const configured = Env.get('REDIS_RPC_URL', '').trim();
|
|
@@ -86,11 +104,11 @@ const createRedisRpcDriver = () => {
|
|
|
86
104
|
const client = await createRpcClient();
|
|
87
105
|
try {
|
|
88
106
|
const snapshot = await client.monitor('getSnapshot', { args: [queueNames] });
|
|
89
|
-
return snapshot.queues ??
|
|
107
|
+
return snapshot.queues ?? emptyQueueStats(queueNames);
|
|
90
108
|
}
|
|
91
109
|
catch (error) {
|
|
92
|
-
Logger.warn('[queue-monitor] Redis RPC batch counts failed; returning
|
|
93
|
-
return
|
|
110
|
+
Logger.warn('[queue-monitor] Redis RPC batch counts failed; returning known queues with empty counts', error);
|
|
111
|
+
return emptyQueueStats(queueNames);
|
|
94
112
|
}
|
|
95
113
|
},
|
|
96
114
|
async getRecentJobs(queueName, limit = 100) {
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,15 @@ export { getRecentJobsForQueue, getRecentJobsForSelection, QueueMonitoringServic
|
|
|
13
13
|
export { createBullMQDriver } from './driver.js';
|
|
14
14
|
export { createMetrics } from './metrics.js';
|
|
15
15
|
export { createWorker as createQueueWorker } from './worker.js';
|
|
16
|
+
const emptyQueueCounts = () => ({
|
|
17
|
+
waiting: 0,
|
|
18
|
+
active: 0,
|
|
19
|
+
completed: 0,
|
|
20
|
+
failed: 0,
|
|
21
|
+
delayed: 0,
|
|
22
|
+
paused: 0,
|
|
23
|
+
});
|
|
24
|
+
const emptyQueueStats = (queues) => queues.map((name) => ({ name, counts: emptyQueueCounts() }));
|
|
16
25
|
const DEFAULTS = {
|
|
17
26
|
enabled: true,
|
|
18
27
|
basePath: '/queue-monitor',
|
|
@@ -268,8 +277,8 @@ function createGetSnapshot(driver, startedAt, knownQueues) {
|
|
|
268
277
|
}));
|
|
269
278
|
}
|
|
270
279
|
catch (error) {
|
|
271
|
-
Logger.warn('[queue-monitor] Queue count lookup failed; returning empty
|
|
272
|
-
return
|
|
280
|
+
Logger.warn('[queue-monitor] Queue count lookup failed; returning known queues with empty counts', error);
|
|
281
|
+
return emptyQueueStats(queues);
|
|
273
282
|
}
|
|
274
283
|
})();
|
|
275
284
|
if (QUEUE_MONITOR_LOGGING_ENABLED) {
|
package/dist/runtime-index.js
CHANGED
|
@@ -13,6 +13,15 @@ import { createMetrics } from './metrics.js';
|
|
|
13
13
|
import { emptyLockAnalytics } from './QueueMonitoringService.js';
|
|
14
14
|
export { createMetrics } from './metrics.js';
|
|
15
15
|
export { createWorker as createQueueWorker } from './worker.js';
|
|
16
|
+
const emptyQueueCounts = () => ({
|
|
17
|
+
waiting: 0,
|
|
18
|
+
active: 0,
|
|
19
|
+
completed: 0,
|
|
20
|
+
failed: 0,
|
|
21
|
+
delayed: 0,
|
|
22
|
+
paused: 0,
|
|
23
|
+
});
|
|
24
|
+
const emptyQueueStats = (queues) => queues.map((name) => ({ name, counts: emptyQueueCounts() }));
|
|
16
25
|
const DEFAULTS = {
|
|
17
26
|
enabled: true,
|
|
18
27
|
basePath: '/queue-monitor',
|
|
@@ -189,8 +198,8 @@ function createGetSnapshot(driver, startedAt, knownQueues) {
|
|
|
189
198
|
const counts = await driver.getJobCounts(name).catch(() => ({}));
|
|
190
199
|
return { name, counts: counts };
|
|
191
200
|
})).catch((error) => {
|
|
192
|
-
Logger.warn('[queue-monitor] Queue count lookup failed; returning empty
|
|
193
|
-
return
|
|
201
|
+
Logger.warn('[queue-monitor] Queue count lookup failed; returning known queues with empty counts', error);
|
|
202
|
+
return emptyQueueStats(queues);
|
|
194
203
|
});
|
|
195
204
|
return {
|
|
196
205
|
status: 'ok',
|