How do I monitor SAP Cloud Platform (Cloud Foundry stack)?

SAP Cloud Platform is the enterprise-class PaaS offering by SAP that comes in two flavors:

  • SAP Cloud Platform Neo
  • SAP Cloud Platform Cloud Foundry

These guidelines apply to the SAP Cloud Platform Cloud Foundry. Feel free to email us for more details for the availability of Dynatrace Monitoring on SAP Cloud Platform Neo.

SAP Cloud Platform Cloud Foundry hosts a number of buildpacks. You can use these guidelines with the following buildpack integrations:

The SAP Java Buildpack is maintained by SAP. The other buildpacks listed above are maintained by the Cloud Foundry Foundation on GitHub. If you experience issues with the integration of Dynatrace into these buildpacks or the NPM module, please get in touch with Dynatrace Support.

Get a Dynatrace account from the SAP App Center

If you don't have a Dynatrace account yet, you can get one from the SAP App Center.

  1. Click the Buy Now button to initiate the purchase order in the SAP App Center.

  2. Select your preferred license model and click Continue.

  3. Select the region closest to your SAP Cloud Platform environment, review the order details information, and click Continue.

  4. Provide your billing details and click Continue.

  5. Review, confirm, and place the order.

  6. You're almost there! Click Go to MyApps and check your inbox for an email from Dynatrace that includes your account information and instructions.

  7. Follow the instructions in the email from Dynatrace.

Generate PaaS token

In your Dynatrace environment, get your environment ID (your environment ID is the string of characters at the beginning of the URL you use to access your Dynatrace environment), and generate a PaaS token for the SAP Cloud Platform.

  1. Login with your Dynatrace account.

  2. Select Deploy Dynatrace from the navigation menu.

  3. Click the Set up PaaS integration button.

  4. Your environment ID appears in the Environment ID text box. You'll need this ID to link your Dynatrace account with your PaaS environment. Click Copy to copy the ID to the clipboard. You can do this at any time by revisiting this page.

  5. To generate a PaaS token, click the Generate new token button. The PaaS token is essentially an API token that's used in combination with your environment ID to download Dynatrace OneAgent. As you will notice, there is already a default InstallerDownload token available that you could alternatively use. However, for security reasons, it is recommended that you create several discrete tokens for different environments.

  6. Type in a meaningful name for your PaaS token. A meaningful token name might be the name of the PaaS platform you want to monitor (for example, azure, cloud-foundry, or openshift). To view and manage your existing PaaS tokens, go to Settings -> Integration -> Platform as a Service.

  7. Click Generate to create the PaaS token. The newly created PaaS token will appear in the list below. Click Copy to copy the generated token to the clipboard. You can do this at any time by revisiting this page and clicking Show token next to the relevant PaaS token.

Create a user-provided service in your SAP Cloud Platform environment

Create a single service instance for Dynatrace with the name dynatrace as a substring. You can use the cf CLI or directly create a user-provided service with the SAP Cloud Platform Cockpit.

You'll need to provide a valid JSON object that contains at least the environmentid and apitoken from the previous step.

For example:

{
	"environmentid": "YOUR_ENVIRONMENTID",
	"apitoken": "YOUR_API_TOKEN",
	"tag:SAP CP": "",
	"tag:Region": "Frankfurt"
}

Bind the Dynatrace service to your application

You can either bind the created Dynatrace service to your application in your manifest.yml file prior to pushing your app or you can bind the service to your app and restage the application afterward.

If you're pushing a Java application, the manifest could look like the following example:

---
applications:
- name: spring-music
  memory: 768M
  instances: 1
  host: spring-music-somerandomstring
  path: spring-music.war
  buildpack: sap_java_buildpack
services:
  - dynatrace-service

Update OneAgent for Cloud Foundry

Whenever a new version of Dynatrace OneAgent becomes available, you need to restart your Cloud Foundry application using cf restage <app_name>. The buildpack will automatically fetch the latest version of Dynatrace OneAgent. Following restart, your applications will be monitored with the latest version of OneAgent.

If you've specified a default OneAgent install version for new hosts and applications in your OneAgent updates settings, the buildpack will automatically fetch the defined default version of OneAgent.