Deploy OneAgent on Cloud Foundry for full-stack monitoring

The following guidelines apply to the deployment of OneAgent to Cloud Foundry VMs, including Cloud Foundry components, Diego cells, and Windows Diego cells.

Before you begin

You'll need to

  • acquire Dynatrace environment credentials.
  • review the list of supported applications and versions.
  • enable Garden and Winc for Windows Server container monitoring (Go to Settings > Process and containers > Container monitoring and in the Automatic container injection for deep monitoring section, enable the Garden containers and Winc for Windows Server containers switches.)
  • get the BOSH CLI

Get your Dynatrace environment ID and PaaS token

The first step is to get your environment ID and the PaaS token for your Dynatrace environment.

Decide which release is right for you

There are two types of OneAgent BOSH releases: immutable and lightweight. The immutable OneAgent BOSH release is self contained and supports BOSH lifecycle management features. This is the recommended approach for installing the OneAgent on Cloud Foundry. For the alternative lightweight version, refer to the Dynatrace Github repository. This version isn't recommended for controlled production environments as it automatically downloads OneAgent releases with each bosh deploy.

Deploy an Environment ActiveGate

Dynatrace SaaS customers must deploy an Environment ActiveGate.

Download the immutable OneAgent BOSH release

These steps should be performed on a machine with the BOSH CLI, access to the BOSH Director, and the environment ActiveGate (SaaS customers only).

Locate the version and download the URLs located in the Environment API.

Get the latest versions of the BOSH release:

 curl -X GET https://{api-url}/api/v1/deployment/boshrelease/versions/unix -H /
 'Authorization: Api-Token {paas-token}'

Download a BOSH release.

Dynatrace SaaS must replace {api-url} with the address of the environment ActiveGate.

wget  -O dynatrace-release.tgz --header="Authorization: Api-Token {paas-token}" /
https://{api-url}/api/v1/deployment/boshrelease/agent/unix/version/{version}?skipMetadata=true

Note: Omit skipMetadata or set to False if you prefer a preconfigured OneAgent.

Upload and deploy the Dynatrace BOSH add-on

Ensure that your bosh CLI is successfully connected to the BOSH director. For details, please refer to Cloud Foundry documentation or Pivotal documentation.

Upload the BOSH release of Dynatrace OneAgent to the BOSH Director:

bosh -e my-env upload-release PATH-TO-BINARY/dynatrace-release.tgz

Optionally, from the command line, you can confirm that upload of the Dynatrace software binary is complete. See the Dynatrace binary file:

bosh releases

Update your runtime configuration to include the Dynatrace OneAgent for BOSH add-on

Create a Dynatrace OneAgent manifest runtime-config-dynatrace.yml with the appropriate settings for your environment. For the recommended immutable release make sure to include the server and tenanttoken keys. For the lightweight release make sure to include the apiurl.

Run the following command to retrieve your tenanttoken:

curl "https://{your-active-gate-url}/e/{environmentid}/api/v1/deployment/installer/agent/connectioninfo?Api-Token={paas-token}" -k

Refer to the example runtime config below:

The Dynatrace OneAgent release that you uploaded in the previous step consists of two jobs. The dynatrace-oneagent job is applicable for Linux VMs. The dynatrace-oneagent-windows job is for Windows VMs. Since the runtime configuration needs to split jobs for Linux and Windows, you need to define two add-on sections in the manifest file.

Note: If you’ve installed other BOSH add-ons, you must merge the Dynatrace manifest into your existing add-on manifest.

Update the BOSH Director runtime configuration

bosh -e my-env update-runtime-config PATH/runtime-config-dynatrace.yml

where PATH denotes the path to the runtime-config-dynatrace.yml file.

The updated runtime configuration applies to all new BOSH deployments going forward.

Note: If you have multiple BOSH runtime configs, with different OneAgent versions, you must delete the older ones using bosh delete-config. Consult the BOSH documentation for details.

Deploy changes and run OneAgent

Since existing BOSH deployments won’t be automatically updated with the jobs specified in the runtime configuration, you need to re-deploy those deployments so that BOSH rolls out OneAgent:

bosh -e my-env -d deployment deploy