DESK OneAgent for Cloud Foundry PaaS is integrated with release v1.6.10 of the Cloud Foundry Node.js buildpack and requires OneAgent version 1.131 or higher. Earlier OneAgent versions (earlier than v1.131) still require the DESK NPM module for PaaS together with an earlier Node.js buildpack release (earlier than v1.6.10). To leverage the NPM module for monitoring your Node.js application, you need to first install and load the module in your application:
Note: For Node.js applications, it's considered best practice to exclude the node_modules
directory from the upload to Cloud Foundry to save time and bandwidth. For this reason add node_modules/
to a text file named .cfignore
.
Run npm install
in your project directory.
$ npm install --save @desk/oneagent
As the first statement of your application, add:
try {
require('@desk/oneagent')();
} catch(err) {
console.log(err.toString());
}
Please note, the buildpack approach is preferable to the NPM module approach due to several improvements. For instance, you're no longer required to install a dependency on @desk/oneagent
in your project directory. You also no longer need to add a require
statement as the first statement of your application.