Deploy Dynatrace integration using a Google Cloud Function

You can deploy the Dynatrace integration as a Google Cloud Function.


To set up integration, follow the instructions below.

  • Install yq version 4.9.x
    Example command to install yq:

    sudo wget -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
  • Create an API token

  • Enable the following permissions for the API token: Ingest metrics (API v2), Read configuration (API v1), and Write configuration (API v1)

  • Determine the URL for your environment.

    • For Dynatrace SaaS: https://<your-environment-id>
    • For Dynatrace Managed: https://<your-domain>/e/<your-environment-id>
    • For ActiveGate: https://<your-active-gate-IP-or-hostname>:9999/e/<your-environment-id>

    Note: To determine <your-environment-id>, see environment ID.

To deploy the Dynatrace GCP function in Google Cloud Shell, download and run the installation script below.

wget -O ; chmod a+x ; ./

Note: The Dynatrace GCP Function uses Cloud Scheduler, which requires the App Engine application. If you don't have App Engine installed, the installer script will prompt you to create App Engine and select the region where you want the installer script to run.

The installation script will prompt for the following parameters:

  • GCP project ID - The ID of the Google Cloud project where you want to deploy the Dynatrace GCP function. The default is set to the current project ID, for the gcloud CLI.
  • Function size - The amount of memory that you want to allocate to the function. You can select one of the following:
    • [s] - Small (allocates 256 MB memory to the function). Select this option if you have up to 500 GCP service instances.
    • [m] - Medium (allocates 512 MB memory to the function). Select this option if you have up to 1,000 GCP service instances.
    • [l] - Large (allocates 2,048 MB memory to the function). Select this option if you have up to 5,000 GCP service instances.

Note: You can adjust the amount of memory after installation.

  • Dynatrace tenant URI - Your Dynatrace environment URL. See Prerequisites for details.
  • Dynatrace API token - Your Dynatrace API token. See Prerequisites for details.

After deploying the integration, you can see metrics from monitored services. If you want to add services to monitoring, see Expand monitoring when using a Google Cloud function.

Verify installation

To check whether installation was successful

  1. In your Google Cloud console, go to Cloud Functions and make sure that dynatrace-gcp-function is there.
  2. Select the newly deployed function and go to Logs to make sure there are no error messages.

Expand monitoring

There are two ways to add services to Dynatrace monitoring when using a Google Cloud Function: via the service configuration file or using the GCP console. See below for instructions.

To add services in the service configuration file

  1. Download the activation-config.yaml service configuration file.
  1. Edit the section in activation-config.yaml by uncommenting the services you want to monitor.

  2. Download and run the dynatrace-gcp-function installation script in the same folder where you downloaded activation-config.yaml.

wget -O ; chmod a+x ; ./