【问题标题】:Where to place pmx attributes in a pm2 managed node app on Heroku?在 Heroku 上的 pm2 托管节点应用程序中将 pmx 属性放在哪里?
【发布时间】:2016-03-08 22:17:42
【问题描述】:

我已经使用 pm2 在 heroku 上部署了一个节点应用程序。由于我们没有控制台来部署 pm2 提供了使用另一个文件 [main.js] 作为启动脚本抽象的官方方式

http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/#heroku-google-app-engine-azure

问题是 pmx 语句[如下所示] 应该去哪里;在上面链接中提到的节点项目 app.js 或 pm2 抽象 main.js 上?

var pmx = require('pmx').init({
  http          : true, // HTTP routes logging (default: true)
  ignore_routes : [/socket\.io/, /notFound/], // Ignore http routes with this pattern (Default: [])
  errors        : true, // Exceptions loggin (default: true)
  custom_probes : true, // Auto expose JS Loop Latency and HTTP req/s as custom metrics
  network       : true, // Network monitoring at the application level
  ports         : true  // Shows which ports your app is listening on (default: false)
});

【问题讨论】:

    标签: node.js heroku pm2


    【解决方案1】:

    在您的项目 app.js 上。 pm2 抽象 main.js 仅用于启动 PM2 并将其链接到 Keymetrics

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-09
      • 1970-01-01
      • 2019-11-24
      • 2020-07-30
      • 2014-05-21
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多