@arcblock/pm2-prom-module 2.6.6 → 2.6.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/core/app.js +1 -0
- package/core/pm2.js +4 -1
- package/metrics/index.js +1 -1
- package/package.json +1 -1
package/core/app.js
CHANGED
package/core/pm2.js
CHANGED
|
@@ -49,6 +49,7 @@ const updateAppPidsData = (workingApp, pidData) => {
|
|
|
49
49
|
status: pidData.status,
|
|
50
50
|
appUrl: pidData.appUrl,
|
|
51
51
|
appName: pidData.appName,
|
|
52
|
+
appPid: pidData.appPid,
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
55
|
const detectActiveApps = () => {
|
|
@@ -95,6 +96,7 @@ const detectActiveApps = () => {
|
|
|
95
96
|
status: pm2_env.status,
|
|
96
97
|
appUrl: pm2_env.BLOCKLET_APP_URL,
|
|
97
98
|
appName: pm2_env.BLOCKLET_APP_NAME,
|
|
99
|
+
appPid: pm2_env.BLOCKLET_APP_PID,
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
102
|
});
|
|
@@ -220,13 +222,14 @@ const detectActiveApps = () => {
|
|
|
220
222
|
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
221
223
|
return {
|
|
222
224
|
appName: app.appName,
|
|
225
|
+
appPid: app.appPid,
|
|
223
226
|
urls: yield (0, domain_1.getAppDomainList)(app.appUrl),
|
|
224
227
|
};
|
|
225
228
|
});
|
|
226
229
|
}), { concurrency: 8 }).then((apps) => {
|
|
227
230
|
for (const app of apps) {
|
|
228
231
|
for (const url of app.urls) {
|
|
229
|
-
metrics_1.metricAppDomainList === null || metrics_1.metricAppDomainList === void 0 ? void 0 : metrics_1.metricAppDomainList.set({ appName: app.appName, domain: url }, app.urls.length);
|
|
232
|
+
metrics_1.metricAppDomainList === null || metrics_1.metricAppDomainList === void 0 ? void 0 : metrics_1.metricAppDomainList.set({ appName: app.appName, domain: url, appPid: app.appPid }, app.urls.length);
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
}).catch(error => console.error(error));
|
package/metrics/index.js
CHANGED
|
@@ -151,7 +151,7 @@ const initMetrics = (prefix) => {
|
|
|
151
151
|
name: `${prefix}_${METRIC_APP_DOMAIN_LIST}`,
|
|
152
152
|
help: 'Show app domain list',
|
|
153
153
|
registers: [exports.registry],
|
|
154
|
-
labelNames: ['appName', 'domain'],
|
|
154
|
+
labelNames: ['appName', 'domain', 'appPid'],
|
|
155
155
|
});
|
|
156
156
|
exports.metricAppAverageMemory = new prom_client_1.default.Gauge({
|
|
157
157
|
name: `${prefix}_${METRIC_APP_AVERAGE_MEMORY}`,
|