@aidra/pmx-io 9.33.0 → 9.35.0

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/README.md CHANGED
@@ -7,7 +7,7 @@ integrations. It keeps the `@pm2/io` API, so code written for PM2.io works uncha
7
7
 
8
8
  * **Run by pmx:** pmx injects this library into every app it starts; nothing to install. An
9
9
  installed copy stays idle and `require` returns the injected instance.
10
- * **Run by PM2 / pm2_prodman:** reports through the PM2 daemon, like `@pm2/io`.
10
+ * **Run by PM2 / pm2_prodman:** reports through the pmx daemon, like `@pm2/io`.
11
11
  * **Standalone** (a container's `node app.js`, an ECS task, a worker): connects to prodman
12
12
  itself as a one-process agent.
13
13
 
@@ -90,7 +90,7 @@ function current (env) {
90
90
  return normalize((env || process.env)[ENV]).value || DEFAULT
91
91
  }
92
92
 
93
- /** PAP-051: the `service.namespace` value, or null: the application, else a non-default pm2 namespace. */
93
+ /** PAP-051: the `service.namespace` value, or null: the application, else a non-default namespace. */
94
94
  function serviceNamespace (application, namespace) {
95
95
  if (application && application !== DEFAULT) return application
96
96
  if (typeof namespace === 'string' && namespace !== '' && namespace !== DEFAULT) return namespace
package/lib/pmx.js CHANGED
@@ -160,8 +160,8 @@ class PMX {
160
160
  }
161
161
  default:
162
162
  }
163
- const underPM2 = process.env.pm_id !== undefined && typeof process.send === 'function'
164
- if (underPM2) return new IPCTransport()
163
+ const underDaemon = process.env.pm_id !== undefined && typeof process.send === 'function'
164
+ if (underDaemon) return new IPCTransport()
165
165
  const present = STANDALONE_KEYS.filter((k) => process.env[k])
166
166
  const wantStandalone = config.standalone === true || present.length === STANDALONE_KEYS.length || process.env.PMX_IO_STANDALONE === '1'
167
167
  if (!wantStandalone && present.length > 0) {
@@ -1085,7 +1085,7 @@ class ProdmanTransport {
1085
1085
  if (!p) return
1086
1086
  try {
1087
1087
  if (ch === 'trigger:action' || ch === 'trigger:scoped_action') this._triggerAction(p)
1088
- else if (ch === 'trigger:pm2:action') this._pm2Action(p)
1088
+ else if (ch === 'trigger:pm2:action') this._remoteAction(p)
1089
1089
  else if (ch === 'status:resend') this._sendStatus(true)
1090
1090
  else if (ch === 'prodman:settings') {
1091
1091
  if (typeof p.collect_logs === 'boolean') this.collectLogs = p.collect_logs
@@ -1132,7 +1132,7 @@ class ProdmanTransport {
1132
1132
  }
1133
1133
  }
1134
1134
 
1135
- _pm2Action (p) {
1135
+ _remoteAction (p) {
1136
1136
  const method = p.method_name
1137
1137
  if (typeof method !== 'string') return
1138
1138
  const params = p.parameters && typeof p.parameters === 'object' ? p.parameters : {}
@@ -474,7 +474,7 @@ class Tracer {
474
474
  'telemetry.distro.name': 'pmx'
475
475
  }
476
476
  // pmx 97 PAP-051: `pmx.application` always; `service.namespace` = the application when it
477
- // isn't `default`, else a non-default pm2 namespace
477
+ // isn't `default`, else a non-default namespace
478
478
  const appl = require('../application')
479
479
  const application = appl.current()
480
480
  this.resource['pmx.application'] = application
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidra/pmx-io",
3
- "version": "9.33.0",
3
+ "version": "9.35.0",
4
4
  "description": "In-process instrumentation for Node.js and Bun apps run by pmx, or reporting to prodman on their own (@pm2/io compatible)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {