• Home
  • Setup and configuration
  • Set up Dynatrace on container platforms
  • Cloud Foundry
  • Deploy OneAgent on Pivotal Web Services for application-only monitoring

Deploy OneAgent on Pivotal Web Services 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.

Note: 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

  1. Create a Dynatrace service in your Cloud Foundry environment.
    There are three ways of defining a service instance, choose one of them:

    Option 1: Create a user-provided service

    Create a single service instance for Dynatrace with the name dynatrace as a substring (for example, dynatrace-service) using the command below. The command should include the parameters environmentid and apitoken written exactly as shown below. Once the command is executed, you'll be prompted to enter your environment ID and API token. The API token corresponds to the PaaS token mentioned above.

    The code examples below use the cf CLI for interfacing with Cloud Foundry clusters.

    bash
    cf cups dynatrace-service -p "environmentid, apitoken"
    bash
    cf cups dynatrace-service -p "environmentid, apitoken, apiurl"

    The apiurl parameter specifies the API endpoint of your Dynatrace Server and needs to be set to https://<YourDynatraceServerURL>/e/<environmentID>/api.

    Option 2: Create a service instance via service broker

    If you want to maintain Dynatrace credentials in a central location, use a service broker. For complete details, visit GitHub. You must 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.

    Option 3: Create a service instance via the service broker on the VMware Tanzu Network

    If you run a VMware Tanzu Platform environment, you can make use of the Dynatrace Service Broker tile on the VMware Tanzu Network.

  2. 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.

    See the example below for pushing a Java application.

    yaml
    --- applications: - name: spring-music memory: 768M instances: 1 host: spring-music-${random-word} path: spring-music.war buildpack: https://github.com/cloudfoundry/java-buildpack.git services: - dynatrace-service
  3. 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 either stdout or stderr.

    For example:

    bash
    cf set-env APP_NAME DT_LOGSTREAM stdout
  4. 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.

    bash
    cf set-env <application> DT_PROXY <proxy address>
  5. optional Configure network zones.

    You can configure network zones in two ways.

    • Via UserProvidedService:
    bash
    cf cups dynatrace-service -p "environmentid, apitoken, networkzone"
    • As an environment variable per application:
    bash
    cf set-env <application> DT_NETWORK_ZONE <your_network_zone>

    See network zones for more information.

Related topics
  • Cloud Foundry monitoring

    Monitor Cloud Foundry with Dynatrace.

  • OneAgent platform and capability support matrix

    Learn which capabilities are supported by OneAgent on different operating systems and platforms.