eggjs / egg

🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
https://eggjs.org
MIT License
18.9k stars 1.82k forks source link

nodejs性能平台看不到错误日志与模块依赖 #2013

Closed wangguohao closed 6 years ago

wangguohao commented 6 years ago

步骤:

另外慢http日志多久不响应会生成?

JacksonTian commented 6 years ago

egg-alinode 默认是监控了 package.json 和 common-error.log 的。

    error_log: [
      path.join(appRoot, `logs/${appInfo.pkg.name}/common-error.log`),
      path.join(appRoot, 'logs/stderr.log'),
    ],
    packages: [
      path.join(appInfo.baseDir, 'package.json'),
    ],

package.json 的依赖检查频度是 1 小时,所以最长需要1小时才能看到数据。

慢日志默认是大于 400ms 的请求。

wangguohao commented 6 years ago

@JacksonTian 谢谢,可以了,不过实例名称可以修改吗?

JacksonTian commented 6 years ago

我们选了 hostname 做为实例名。修改 hostname 会修改 实例名。

Gorden-Wang commented 6 years ago

@JacksonTian 我也遇到了相同的问题,error_log没有监控到。我的具体场景是这样的:

config.logger = {
        dir: `/data/logs/${appInfo.name}${ACS_INSTANCE_ID}`,
    };
    config.alinode = {
        enable: true,
        appid: 'XXX',
        secret: 'XXX',
        error_log: [
            `/data/logs/${appInfo.name}${ACS_INSTANCE_ID}/common-error.log`,
        ],
    };

logger的输出位置指定到了相应的目录,ACS_INSTANCE_ID,查看 /data/logs/${appInfo.name}${ACS_INSTANCE_ID}/common-error.log日志:

018-04-24 04:34:19,688 ERROR 46 nodejs.Error: Command failed: cat /proc/14156/environ
cat: /proc/14156/environ: No such file or directory

cat: /proc/14156/environ: No such file or directory

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:567:12)
killed: false
code: 1
signal: null
cmd: 'cat /proc/14156/environ'
pid: 46
hostname: ****

另外,相应的access-****.log存在大于400ms的请求,alinode性能平台确没有任何满请求日志,请不吝解惑。多谢

JacksonTian commented 6 years ago

@Gorden-Wang 请加我们的钉钉群 507028892 或者加我个人 钉钉 朴灵

shiny commented 6 years ago

我也出现一堆类似 cat: can't open '/proc/17677/environ': No such file or directory 的错误,使用的是 alinode 的 docker 环境