@arextest/arex-node-runner v0.0.1-beta.8
背景
arex node-agent 中间件启动器
环境
- node v18
- npm --registry https://registry.npmjs.org
- arex-node-agent
- arextest https://github.com/arextest/arex
内容
- 包含通过APPID装载平台配置的中间件,自定义js装载等
- 包含初始化agent逻辑
- 包含按照APP配置初始化agent 执行频次,启停等
运行方案
- 安装启动runner
npm install @arextest/arex-node-runner -g --registry https://registry.npmjs.org
- trip
npm install @arextest/arex-node-runner@1.0.3-beta.15 --registry http://registry.npm.release.ctripcorp.com
- 配置环境变量
export AREX_HOST=http://xxx:8093
export APPID=demo01
export INSTRUMENTATIONS=ArexHttpInstrumentation,ArexHttpClientInstrumentation
- 修改export 让require支持远程npm包
export NODE_PATH=$(npm root -g)
- 配置启动命令
node --require @arextest/arex-node-runner dist/main.js
- PM2 方案
- 支持pm2 fork 模式
配置参数:--node-args="--require @arextest/arex-node-runner"
- 支持pm2 cluster多实例模式
配置参数:
--interpreter="node" \ --interpreter-args='--require @arextest/arex-node-runner'
案例: `pm2 start ./dist/src/main.js\ --name $appname\ -i 4 \ --merge-logs\ --log-date-format="YYYY-MM-DD HH:mm:ss"\ --log /opt/logs/$appid/outerr.log\ --output /opt/logs/$appid/out.log\ --error /opt/logs/$appid/err.log\ --interpreter="node" \ --interpreter-args='--require @arextest/arex-node-runner'
exit 0`# --node-args="--require @arextest/arex-node-runner" \
- 支持pm2 fork 模式
通过js参数传递:-- --APPID N$appname --AREX_HOST http://xxx --INSTRUMENTATIONS ArexHttpInstrumentation,ArexHttpClientInstrumentation,ArexMysql2Instrumentation
` NODE_ENV=production pm2 start dist/main.js \ -i $instance \ --name $appname \ --merge-logs \ --log-date-format "YYYY-MM-DD HH:mm:ss.SSS" \ --log "/opt/logs/$appid/outerr.log" \ --output "/opt/logs/$appid/out.log" \ --error "/opt/logs/$appid/err.log" \ --interpreter-args='--require /opt/nodeapp/node_modules/@arextest/arex-node-runner/dist/index.js'\ -- --APPID N$appname --AREX_HOST http://xxx --INSTRUMENTATIONS ArexHttpInstrumentation,ArexHttpClientInstrumentation,ArexMysql2Instrumentation
exit 0 `
参考
- npm 发布流程
- 申请权限
npm login --registry https://registry.npmjs.org
npm publish --registry https://registry.npmjs.org --access=public
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
12 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago