Deploy OneAgent on Heroku

The following guidelines explain how to enable Dynatrace monitoring for your Heroku applications by adding a Dynatrace Heroku buildpack to the Heroku configuration of your application.

Note: The Dynatrace Heroku buildpack enables you to monitor all supported languages on Linux systems.

Prerequisites

Installation

These guidelines explain how to integrate Dynatrace OneAgent into your Heroku dynos and begin monitoring your Heroku applications.

Get the Heroku CLI

To configure Heroku applications to use the Dynatrace Heroku buildpack, you can either use the Heroku CLI or you can configure your applications using the Heroku dashboard.

Add the Dynatrace Heroku buildpack

To integrate Dynatrace OneAgent into your existing application, you need to add the Dynatrace Heroku buildpack to your application buildpacks and set your Dynatrace environment ID and PaaS token using the commands below.

# Add the Dynatrace buildpack
heroku buildpacks:add https://github.com/Dynatrace/heroku-buildpack-dynatrace.git#<version>

# Set required credentials to your Dynatrace environment
heroku config:set DT_TENANT=<environmentID>
heroku config:set DT_API_TOKEN=<token>

# Deploy to Heroku
git push heroku master

Once you push these changes, the buildpack installs Dynatrace OneAgent to automatically monitor your application.

Additional configuration

The Dynatrace Heroku buildpack supports the following configurations:

Environment variable Description
DT_TENANT Your Dynatrace environment ID
Note: For details on how to determine your environment ID, see environment ID.
DT_API_TOKEN The PaaS token for integrating your Dynatrace environment with Heroku
DT_API_URL - For Dynatrace SaaS, where OneAgent can connect to the internet: https://<your-environment-ID>.live.dynatrace.com/api
- For Dynatrace Managed: https://<your-managed-cluster-domain>/e/<your-environment-ID>/api
- For environment ActiveGates (SaaS or Managed), use the following to download the OneAgent, as well as to communicate OneAgent traffic through the ActiveGate: https://<your-ActiveGate-IP-or-FQDN>:9999/e/<your-environment-ID>/api
Note: For details on how to determine your environment ID, see environment ID.
DT_DOWNLOAD_URL optional A direct download URL for Dynatrace OneAgent. If this environment variable is set, the buildpack will download OneAgent from this location
SSL_MODE optional Set to all if you want to accept all self-signed SSL certificates
DT_TAGS optional The tags you want to add to the monitored applications
SKIP_ERRORS optional If set to 1, application deployment won't fail on OneAgent installer download errors

Note: You can use a different Dynatrace environment for Heroku applications that are enriched with OneAgent.

Configure network zones optional

You can configure network zones via an environment variable:

heroku config:set DT_NETWORK_ZONE=<your.network.zone>

See network zones for more information.