@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 CHANGED
@@ -59,6 +59,7 @@ class App {
59
59
  status: pidData.status,
60
60
  appUrl: pidData.appUrl,
61
61
  appName: pidData.appName,
62
+ appPid: pidData.appPid,
62
63
  };
63
64
  }
64
65
  else {
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}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/pm2-prom-module",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },