@aidra/pmx-io 0.0.0-stage → 9.13.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 +69 -2
- package/bin/pmx-io-node.js +143 -0
- package/index.d.ts +381 -0
- package/index.js +27 -0
- package/index.mjs +47 -0
- package/lib/actions.js +120 -0
- package/lib/activate.js +402 -0
- package/lib/application.js +106 -0
- package/lib/bun.js +155 -0
- package/lib/config.js +67 -0
- package/lib/constants.js +17 -0
- package/lib/debug.js +48 -0
- package/lib/esm-hooks.mjs +111 -0
- package/lib/exit.js +79 -0
- package/lib/features/metrics.js +409 -0
- package/lib/features/notify.js +358 -0
- package/lib/features/profiling.js +208 -0
- package/lib/hooks.js +151 -0
- package/lib/inbound.js +174 -0
- package/lib/integrations.js +372 -0
- package/lib/itg/amqplib.js +169 -0
- package/lib/itg/bullmq.js +141 -0
- package/lib/itg/common.js +657 -0
- package/lib/itg/dbcomment.js +114 -0
- package/lib/itg/index.js +103 -0
- package/lib/itg/ioredis.js +212 -0
- package/lib/itg/kafkajs.js +205 -0
- package/lib/itg/mongodb.js +322 -0
- package/lib/itg/mysql2.js +205 -0
- package/lib/itg/nats.js +531 -0
- package/lib/itg/noderedis.js +236 -0
- package/lib/itg/pg.js +253 -0
- package/lib/itg/pgqueue.js +305 -0
- package/lib/itg/postgres.js +252 -0
- package/lib/itg/redis-common.js +265 -0
- package/lib/itg/sql.js +302 -0
- package/lib/metrics/service.js +286 -0
- package/lib/metrics/types.js +342 -0
- package/lib/modules.js +260 -0
- package/lib/node-options.js +62 -0
- package/lib/otel/bridge.js +797 -0
- package/lib/otel/env.js +114 -0
- package/lib/outbound.js +362 -0
- package/lib/pmx.js +757 -0
- package/lib/relay/hub.js +279 -0
- package/lib/relay/transport.js +253 -0
- package/lib/standalone/activate.js +307 -0
- package/lib/standalone/capture.js +55 -0
- package/lib/standalone/container.js +909 -0
- package/lib/standalone/transport.js +1023 -0
- package/lib/tracing/context.js +90 -0
- package/lib/tracing/control.js +124 -0
- package/lib/tracing/exporter.js +115 -0
- package/lib/tracing/index.js +242 -0
- package/lib/tracing/logs.js +176 -0
- package/lib/tracing/options.js +105 -0
- package/lib/tracing/paths.js +34 -0
- package/lib/tracing/tracer.js +850 -0
- package/lib/tracing/w3c.js +415 -0
- package/lib/transport/ipc.js +97 -0
- package/lib/transport/ws.js +511 -0
- package/lib/util.js +109 -0
- package/package.json +48 -4
- package/preload.cjs +26 -0
- package/preload.mjs +25 -0
- package/standalone.cjs +16 -0
- package/standalone.mjs +17 -0
package/preload.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (c) 2026 Mike Warriner. All rights reserved. Proprietary — see LICENSE.
|
|
2
|
+
|
|
3
|
+
// ES module preload, injected with `--import` only when ESM instrumentation (tracing) is
|
|
4
|
+
// enabled (02 D-05, 80 INJ-010). It shares state with preload.cjs (which Node runs first),
|
|
5
|
+
// activates on its own when used alone, and registers the module customization hooks that wrap
|
|
6
|
+
// ES-module libraries when tracing is on (NIO-085, NIO-210). It never registers a hook otherwise.
|
|
7
|
+
|
|
8
|
+
import { createRequire } from 'node:module'
|
|
9
|
+
|
|
10
|
+
const require = createRequire(import.meta.url)
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const env = process.env
|
|
14
|
+
const alreadyActive = Boolean(globalThis[Symbol.for('@pmx/io:preload-state')])
|
|
15
|
+
if (alreadyActive || ((env.PMX_IO === '1' || (!env.PMX_IO && env.PMX_IO_HUB && env.PMX_IO_STANDALONE !== '1')) &&
|
|
16
|
+
env.pmx !== 'false' && env.automation !== 'false')) {
|
|
17
|
+
const activation = require('./lib/activate.js')
|
|
18
|
+
activation.activate()
|
|
19
|
+
activation.registerEsmHooks()
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
try {
|
|
23
|
+
process.stderr.write('[pmx] instrumentation disabled: ' + (err && err.message) + '\n')
|
|
24
|
+
} catch (_) {}
|
|
25
|
+
}
|
package/standalone.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) 2026 Mike Warriner. All rights reserved. Proprietary — see LICENSE.
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
// Standalone preload entry `@aidra/pmx-io/standalone` (80 NIO-261): for
|
|
5
|
+
// `node --require @aidra/pmx-io/standalone app.js`, NODE_OPTIONS and the `pmx-io-node` launcher. Sets
|
|
6
|
+
// PMX_IO_STANDALONE=1 (and PMX_IO_ROOT_PID when unset), adds itself to NODE_OPTIONS so that Node
|
|
7
|
+
// descendants load it too, then activates as the tree's root or as a relay (NIO-263). Any failure
|
|
8
|
+
// leaves the app untouched.
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
require('./lib/standalone/activate.js').fromPreload()
|
|
12
|
+
} catch (err) {
|
|
13
|
+
try {
|
|
14
|
+
process.stderr.write('[@pm2/io] standalone mode disabled: ' + (err && err.message) + '\n')
|
|
15
|
+
} catch (_) {}
|
|
16
|
+
}
|
package/standalone.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) 2026 Mike Warriner. All rights reserved. Proprietary — see LICENSE.
|
|
2
|
+
|
|
3
|
+
// Standalone preload entry for `--import` (80 NIO-261): activates like standalone.cjs and, when
|
|
4
|
+
// tracing is enabled, registers the module customization hooks of NIO-085.
|
|
5
|
+
|
|
6
|
+
import { createRequire } from 'node:module'
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url)
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
require('./lib/standalone/activate.js').fromPreload()
|
|
12
|
+
require('./lib/activate.js').registerEsmHooks()
|
|
13
|
+
} catch (err) {
|
|
14
|
+
try {
|
|
15
|
+
process.stderr.write('[@pm2/io] standalone mode disabled: ' + (err && err.message) + '\n')
|
|
16
|
+
} catch (_) {}
|
|
17
|
+
}
|