Monitor AWS App Runner
To deploy OneAgent on App Runner, read the instructions provided below.
Prerequisites
- Create an API token in your Dynatrace environment and enable the following permissions:
- Access problem and event feed, metrics, and topology (
DataExport
) (API v1) - PaaS integration - Installer download (
InstallerDownload
)
- Access problem and event feed, metrics, and topology (
- Review the list of supported applications and versions.
Integrate OneAgent into your application image
Build-time injection
Build-time injection (for ECS, EKS, and App Runner) embeds OneAgent into your container image.
To use this option you need:
Docker version 17.05+
OneAgent version 1.155+
-
Sign in to Docker with your Dynatrace environment ID as username and your PaaS token as password.
1docker login -u <your-environment-id> <your-environment-url> -
Add two additional lines of code to the application image after the last
FROM
command:1COPY --from=<your-environment-url>/linux/oneagent-codemodules:<technology> / /2ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so- Replace
<your-environment-url>
with the URL or IP address of your environment or your ActiveGate. - Replace
<technology>
with the code module required for your application. Valid options areall
,java
,apache
,nginx
,nodejs
,dotnet
,php
,sdk
, andgo
. You can specify several code modules, separated by hyphen (-
), for examplejava-go
. Including specific technology-support options, rather than support for all technology options, results in a smaller OneAgent package.
What if my Docker image is based on Alpine Linux?
Dynatrace OneAgent supports Alpine Linux–based environments. Use this syntax:
1COPY --from=<your-activegate>/linux/oneagent-codemodules-musl:<technology> / /2ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.soValid options here are
all
,go
,java
,apache
,nginx
, andnodejs
. - Replace
-
Build your application image.
Build the Docker image from your dockerfile to use it in your Kubernetes environment:
1docker build -t yourapp .You can monitor your application containers with a different Dynatrace environment. To do this, read the instructions below:
For OneAgent version 1.139+, if you have an existing application image where you've already added the OneAgent code modules for a specific Dynatrace environment, you can have the OneAgent report to another Dynatrace environment without rebuilding your application image.
For this you need to make a call to the REST endpoint of your second Dynatrace environment. Make sure to adapt the respective placeholders
<your-environment-id>
and<your-paas-token>
.1curl "https://<your-environment-id>.live.dynatrace.com/api/v1/deployment/installer/agent/connectioninfo?Api-Token=<your-paas-token>"In return, you get a JSON object that covers the required information that needs to be passed as an environment variable to the application container. Make sure you set the environment variables of the application container as described below:
DT_TENANT
: equalstenantUUID
DT_TENANTTOKEN
: equalstenantToken
DT_CONNECTION_POINT
: semi-colon separated list ofcommunicationEndpoints
Troubleshoot OneAgent integration issues
If you encounter issues integrating OneAgent, use troubleshooting variable DT_LOGLEVELCON
= INFO
. This will enable you to see OneAgent logs in the CloudWatch logs.
-
Build-time injection
Enter an additional line of code to the application image as in the example below:1COPY --from=<your-environment-url>/linux/oneagent-codemodules:<technology> / /2ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so3ENV DT_LOGLEVELCON INFO
Configure network zones optional
You can configure network zones as an environment variable:
DT_NETWORK_ZONE
: equalsyour.network.zone
See network zones for more information.
Monitoring Consumption
For AWS App Runner, monitoring consumption is based on host units. See Application and Infrastructure Monitoring (Host Units) for details.