Application observability with pod runtime injection

Inject OneAgent code modules into a container during its deployment.

This method of application instrumentation may not fully link Kubernetes workloads with monitored containers/processes. For comprehensive relationships and linking, consider using the automatic application-only injection.

Prerequisites

Deploy

To integrate OneAgent into your application at runtime, select one of the options below based on your platform.

Update

Each time you want to leverage a new OneAgent version, you only need to redeploy your pods. In runtime injections, OneAgent is downloaded and injected within an initContainer. By default, the latest version of OneAgent is downloaded, but you can control which OneAgent version is downloaded by specifying it in the download URL.

Uninstall

To uninstall OneAgent from application-only monitoring

  1. Remove the install-oneagent YAML from your deployment template.

    # your application containers
    containers:
    - name: customer-app
    image: tomcat
    env:
    - name: LD_PRELOAD
    value: /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
    volumeMounts:
    - mountPath: /opt/dynatrace/oneagent
    name: oneagent
    # initContainer to download OneAgent
    initContainers:
    - name: install-oneagent
    image: alpine:3.8
    command:
    - /bin/sh
    args:
    - -c
    - ARCHIVE=$(mktemp) && wget -O $ARCHIVE "$DT_API_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT_PAAS_TOKEN&$DT_ONEAGENT_OPTIONS" && unzip -o -d /opt/dynatrace/oneagent $ARCHIVE && rm -f $ARCHIVE
    env:
    - name: DT_API_URL
    value: https://<Your-environment-ID>.live.dynatrace.com/api
    - name: DT_PAAS_TOKEN
    value: <paastoken>
    - name: DT_ONEAGENT_OPTIONS
    value: flavor=<FLAVOR>&include=<TECHNOLOGY>
    volumeMounts:
    - mountPath: /opt/dynatrace/oneagent
    name: oneagent
    # Make OneAgent available as a volume
    volumes:
    - name: oneagent
    emptyDir: {}
  2. Redeploy your application.