Dynatrace OneAgent is a Java agent that sends all captured monitoring data to your Dynatrace monitoring environment for analysis.
Dynatrace supports full-stack monitoring for Cloud Foundry – from the application to the infrastructure layer. To integrate it with your Java application, follow the steps below.
-
Obtain an environment ID and an API access token.
-
Create a user-provided service.
The service name should contain the string "dynatrace" (for example, dynatraceservice). The
environmentidandapitokenparameters have been generated in the previous step. You also need to set up theapiurl, which depends on the Dynatrace type you want to integrate.-
SaaS Dynatrace
"apiurl": "https://<environmentid>.live.dynatrace.com/api" -
Managed Dynatrace
"apiurl": "https://<your_domain>/e/<environmentid>/api"
Then, in cf CLI, run the following command:
cf cups dynatraceservice -p "environmentid, apitoken, apiurl"For more information, see:
-
Dynatrace Docs: Create a user-provided service in your SAP BTP, Cloud Foundry Environment
-
Cloud Foundry Docs: User-Provided Service Instances
-
-
Bind the application to the service instance created in the previous step, by using the manifest.yml file.
--- applications: - name: myapp memory: 1G instances: 1 buildpack: sap_java_buildpack_jakarta services: - dynatraceserviceNOTE: If there are more than one Dynatrace services bound to the application, the service that's going to be used is the one that was chronologically bound first.
-
Deploy the application to the SAP BTP, Cloud Foundry environment with the updated manifest.yml file. Run:
cf push myappOnce the application receives Web traffic, monitoring data will show up in Dynatrace.
Related Information