Deploy OneAgent on IBM Cloud Foundry for application-only monitoring
Applications deployed on Cloud Foundry are usually run through technology-specific buildpacks that provide framework and runtime support for applications running on the Cloud Foundry platform. For complete details, see how buildpacks work.
When deployed in application-only mode, OneAgent monitors the memory, disk, CPU, and networking of processes within the container only. Host metrics aren't monitored.
Prerequisites
- Create a PaaS Token.
- Review the supported applications and versions.
Deploy OneAgent
-
Create a Dynatrace service in your IBM Cloud Foundry environment.
There are two ways of defining a service instance, choose one:Create a single service instance for Dynatrace with the name
dynatrace
as a substring, like in the example below. You will then be prompted for your environment ID and API token. The API token corresponds to the token mentioned above.1cf cups dynatrace-service -p "environmentid, apitoken"If you want to maintain Dynatrace credentials in a central location, use a service broker. For details, visit GitHub. You need to configure and run the broker as an application, add the service broker to Cloud Foundry, enable service access to users, and finally, create the service instance.
-
Bind Dynatrace service to your application.
You can bind the created Dynatrace service to your application in your
manifest.yml
file. If your application is already started, you need to restage it.In case of a Java application, if you're deploying to IBM Cloud Foundry, be sure to accept IBM licenses by setting the proper environment variables. For details, see the buildpack readme.
1---2applications:3- name: demo-helloworld4 path: target/JavaHelloWorldApp.war5 buildpack: https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack.git6 memory: 512M7 instances: 18 host: hello-world-${random-word}9 disk_quota: 1024M10services:11 - dynatrace-service12env:13 IBM_LIBERTY_LICENSE: <liberty-license-key>14 IBM_JVM_LICENSE: <jvm-license-key> -
optional Configure the default OneAgent log stream for Cloud Foundry.
By default, OneAgent logs are written to the Cloud Foundry standard error stream. All you have to do is set the environment variable
DT_LOGSTREAM
to eitherstdout
orstderr
.For example:
1cf set-env APP_NAME DT_LOGSTREAM stdout -
optional Configure a proxy address.
If your environment uses a proxy, you need to set the
DT_PROXY
environment variable to pass the proxy credentials to OneAgent as shown below.1cf set-env <application> DT_PROXY <proxy address> -
optional Configure network zones.
You can configure network zones in two ways.
- Via
UserProvidedService
:
1cf cups dynatrace-service -p "environmentid, apitoken, networkzone"As an environment variable per application:
1cf set-env <application> DT_NETWORK_ZONE <your_network_zone>See network zones for more information.
- Via