We’re happy to announce that Dynatrace has once again broadened its support for Cloud Foundry technology-specific buildpacks. We already support buildpacks for Java, PHP and Staticfile applications, and applications that run on IBM WebSphere Liberty. As of today, Dynatrace also supports Cloud Foundry’s Node.js buildpack for monitoring Node.js applications that are deployed in Cloud Foundry PaaS environments.
Benefits of the buildpack approach
Until now, you were required to install the Dynatrace NPM module for PaaS and load the module in your Node.js application. The buildpack approach supersedes the Dynatrace NPM module for PaaS due to several improvements:
- You no longer need to install a dependency on
@dynatrace/oneagent
in your project directory. - You’re no longer required to add the following statement as the first statement of your application:
try {
require('@dynatrace/oneagent')();
} catch(err) {
console.log(err.toString());
}
Improved OneAgent error handling
The Dynatrace integration for the Node.js buildpack allows you to successfully push your application even when the download of Dynatrace OneAgent fails (for example, because of a network connection error). You can configure OneAgent error handling via the option skiperrors
that you can specify in the payload of the user-provided Dynatrace Cloud Foundry service that’s bound to your application:
cf cups dynatrace-service -p "environmentid, apitoken, skiperrors"
You’re prompted automatically to provide your environment ID, API token, and either true
or false
for the skiperrors
flag. Please note, by default, an unsuccessful download of Dynatrace OneAgent will result in a deployment error.
Improved OneAgent update experience
- With the buildpack approach you no longer rely on releases of the Dynatrace OneAgent dependencies for NPM.
- The buildpack automatically fetches the latest version of Dynatrace OneAgent. If you’ve specified a default OneAgent install version for new hosts and applications in your OneAgent updates settings, the buildpack will download the defined default version of Dynatrace OneAgent.
- Potential fixes can now also be rolled out faster and more easily than they could previously.
Start monitoring Cloud Foundry PaaS applications
If you’re eager to start using the buildpack approach instead of the Dynatrace NPM module for PaaS, we’ve got you covered. All you have to do is remove the dependency on @dynatrace/oneagent
in your package.json
file:
npm uninstall --save @dynatrace/oneagent
Further, you can also remove the require
statement mentioned above from your application.
To set up Cloud Foundry monitoring and start using the Dynatrace integration into the Node.js buildpack you first need to link your Dynatrace account with your Cloud Foundry applications. To do this, you need to create a Dynatrace service in your Cloud Foundry environment and bind it to your Node.js application. For complete details, please see the Cloud Foundry installation guidelines.
Define Cloud Foundry service tags for multiple applications
Dynatrace recently introduced a powerful feature that automatically detects Cloud Foundry tags supplied via any user-provided Dynatrace Cloud Foundry service that’s bound to your application. This enables you to automatically organize and filter all monitored Cloud Foundry application components. The Dynatrace Node.js buildpack integration allows you to leverage not only one, but several Dynatrace Cloud Foundry service instances to define Dynatrace tags. Additionally, Dynatrace automatically detects tags that are provided via Cloud Foundry environment variables for applications. For complete details, please see How do I define tags with Cloud Foundry services? Your Cloud Foundry tags are automatically attached to monitored processes that are related to your Node.js application:
Your feedback
We’d love to hear from you. Tell us what you think about the new Dynatrace integration into the Node.js buildpack. Please share your feedback at Dynatrace Community.
Note: Dynatrace OneAgent for Cloud Foundry PaaS is integrated with release v1.6.10 of Cloud Foundry’s Node.js buildpack and requires OneAgent version 1.131 or higher. Earlier OneAgent versions < 1.131 still require the Dynatrace NPM module for PaaS together with an earlier Node.js buildpack release < v1.6.10.
Looking for answers?
Start a new discussion or ask for help in our Q&A forum.
Go to forum