Google App Engine is a managed application platform that supports most modern languages. The Google App Engine "standard environment" type supports applications that run on Java, .NET, Node.js, Golang, and more. For custom Docker images, Google App Engine provides "flexible environment" support, so you can run custom Docker images in flexible environment mode.
Generate an environment ID and a PaaS token
- Sign in using your Dynatrace account.
- Select Deploy Dynatrace from the left-hand menu.
- Select Set up PaaS integration.
- Your environment ID appears in the Environment ID text box. You'll need this ID to link your Dynatrace account with your PaaS environment. Select Copy to copy the ID to the clipboard. You can do this at any time by revisiting this page.
- To generate a PaaS token, select Generate new token.
The PaaS token is essentially an API token that's used in combination with your environment ID to download OneAgent. As you'll see, there's also a default InstallerDownload token available that you can alternatively use. However, for security reasons, it's recommended that you create several discrete tokens for each environment you have.
- Enter a meaningful name for your PaaS token. A meaningful token name might be the name of the PaaS platform you want to monitor (for example,
- Select Generate to create the PaaS token. The newly created PaaS token will appear in the list below. Select Copy to copy the generated token to the clipboard. You can do this at any time by revisiting this page and selecting Show token next to the relevant PaaS token.
Alternatively you can use the POST a new token API call to generate a token with the
- Review the list of supported applications and versions.
Integrate OneAgent into application images
To integrate OneAgent into a container deployment with a Dockerfile in Google App Engine flexible environment and activate instrumentation of your application, add the following commands to your current Dockerfile.
ARG DT_API_URL="https://<environmentID>.live.dynatrace.com/api" ARG DT_API_TOKEN="<token>" ARG DT_ONEAGENT_OPTIONS="flavor=default&include=<technology1>&include=<technology2>" ENV DT_HOME="/opt/dynatrace/oneagent" RUN mkdir -p "$DT_HOME" && \ wget -O "$DT_HOME/oneagent.zip" "$DT_API_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT_API_TOKEN&$DT_ONEAGENT_OPTIONS" && \ unzip -d "$DT_HOME" "$DT_HOME/oneagent.zip" && \ rm "$DT_HOME/oneagent.zip" ENTRYPOINT [ "/opt/dynatrace/oneagent/dynatrace-agent64.sh" ] CMD [ "executable", "param1", "param2" ] # the command of your application, for example, Java
Note: The commands above that use
unzip might fail if they aren't provided by the base image.
Regarding the code snippet above:
As shown in the code snippet, first, you need to define variables with default values using
Technology support is enabled via
includeparameters. Valid options for
go. Including specific technology-support options, rather than support for all technology options, results in a smaller OneAgent package.
<environmentID>should be replaced with your Dynatrace environment ID. If you’re using Dynatrace Managed, you need to provide your Dynatrace Server URL (
<token>should be replaced with the PaaS token mentioned above.
Dynatrace OneAgent supports the flavor
musl for Alpine Linux based environments. Valid options for
Deploy the application image
After integrating the OneAgent to the application Dockerfile, you need to deploy the application, for example, with the
gcloud CLI. In order to do this, switch to the directory of the application that contains the
Dockerfile and the
app.yaml file, and run the following command.
$ gcloud app deploy
Google App Engine will take care of building the Docker image based on the
Dockerfile provided and thereby of downloading and installing the OneAgent code-modules into the application image.