Deploy Dynatrace integration using a Google Cloud Function

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

Install

To set up integration, follow the instructions below.

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

    sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.8/yq_linux_amd64 -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>.live.dynatrace.com
    • 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 https://raw.githubusercontent.com/dynatrace-oss/dynatrace-gcp-function/master/scripts/setup.sh -O setup.sh ; chmod a+x setup.sh ; ./setup.sh

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.
wget https://raw.githubusercontent.com/dynatrace-oss/dynatrace-gcp-function/master/activation-config.yaml
  1. Edit the activation.metrics.services 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 https://raw.githubusercontent.com/dynatrace-oss/dynatrace-gcp-function/master/scripts/setup.sh -O setup.sh ; chmod a+x setup.sh ; ./setup.sh